Metadata-Version: 2.5
Name: starbridge-hardware
Version: 4.4.0
Summary: Python SDK for the StarBridge platform and StarCore board
Project-URL: Homepage, https://github.com/HAOTIANGUO22/StarBridge
Project-URL: Documentation, https://github.com/HAOTIANGUO22/StarBridge#readme
Project-URL: Repository, https://github.com/HAOTIANGUO22/StarBridge
Project-URL: Issues, https://github.com/HAOTIANGUO22/StarBridge/issues
Author: StarBridge contributors
License: MIT License
        
        Copyright (c) 2026 StarBridge contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: education,esp32,hardware,iot,starbridge,starcore
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Education
Classifier: Topic :: Software Development :: Embedded Systems
Requires-Python: >=3.10
Provides-Extra: test
Requires-Dist: pytest<9,>=8; extra == 'test'
Description-Content-Type: text/markdown

# StarBridge Python SDK 4.4

Install the public distribution from PyPI:

```bash
python -m pip install starbridge-hardware
```

The PyPI distribution is named `starbridge-hardware`; the Python import package remains `starbridge`.

```python
from starbridge import Board, BoardType, Pin, PinMode

with Board.begin(BoardType.STARCORE_V2) as board:
    print(board.info())
    board.pin_mode(Pin.P0, PinMode.OUTPUT)
    board.digital_write(Pin.P0, True)

    print(board.dht11(Pin.P1).read())
    print(board.ultrasonic(Pin.P6, Pin.P7).read_cm())
```

The SDK communicates with protocol-v2 firmware. It does not silently fall back to the legacy protocol.

`Board.begin()` detects the serial port and reuses compatible firmware. On Windows, the official wheel contains precompiled StarCore V2 firmware and esptool, so first-time provisioning works without Arduino IDE, Arduino CLI, an installed ESP32 core, or firmware source. Pass `port="COM7"` to override discovery or `force_flash=True` to request a new upload.

The wheel includes only the public Python SDK, precompiled flash images, their integrity manifest, and the Windows x86-64 esptool runtime. Firmware production source is maintained separately and is not distributed in this repository or wheel.

Version 4.4 recognizes both CP210x and CH9102 USB-to-serial bridges. First-time flashing displays the StarBridge, SDK and firmware versions plus a progress bar. Hardware command failures include Chinese troubleshooting guidance while retaining the numeric command and status for diagnostics.
