Skip to content

v0.2.0

Choose a tag to compare

@vihaanvp vihaanvp released this 04 Jul 05:07
· 6 commits to main since this release

v0.2.0 (2026-07-04)

Major refactor and stabilization release — type hints, dual Firmata backend, optional deps, sensor support.

Added

  • Full type hints on all public APIs: Board, Motor, Servo, VL53L0X, delay, millis, exceptions.
  • Board.__repr__ — shows serial port + motor count (pyserial mode only; graceful fallback for pyfirmata2).
  • Board.has_active_board() — static check without raising.
  • Servo.__repr__ — three states: "Servo(not attached)", "Servo(pin=X, angle=unknown)", "Servo(pin=X, angle=Y)".
  • Dual Firmata backend — set_mode("pyserial") / set_mode("pyfirmata2") global switch (must be called before Board()). Built-in pyserial client removes hard dependency on pyfirmata2.
  • VL53L0X time-of-flight sensor — VL53L0X class in megawrapper.sensor, I2C-based, independent of Firmata/Board.
  • Optional dependency groups in pyproject.toml:
    • pip install -e '.[pyserial]' — built-in Firmata backend
    • pip install -e '.[sensor]' — VL53L0X sensor
  • New examples:
    • examples/pyserial_control.py — demonstrates pyserial backend
    • examples/vl53l0x_sensor.py — ToF distance readout
  • PyPI publish workflow — .github/workflows/publish.yml triggers on GitHub release.
  • Tests expanded to 92 — new test_sensor.py, pyserial-mode tests in test_board.py.

Changed

  • pyproject.toml: pyserial and adafruit-circuitpython-vl53l0x moved from hard deps → optional extras. Only pyfirmata2 remains required.
  • README.md rewritten — wiki-centric, examples table with descriptions, concise API overview.
  • AGENTS.md rewritten — accurate test count, dependency structure, architecture traps, testing quirks.
  • .gitignore: 94 lines → 13 (only patterns matching this project).
  • Internal cleanup: inlined single-use imports, removed dead analog-write branch (pins >= 16 unused).

Removed

  • examples/servo_test.py (90% overlap with endless_sweep.py)
  • examples/endless_servo_sweep.py (redundant with Servo.sweep())
  • requirements.txt (duplicates pyproject.toml)
  • tests/__init__.py (empty file)

Notes

  • Requires Python 3.8+, Arduino running StandardFirmata.
  • Hard dependency: pyfirmata2 only. Optional: pyserial (backend), adafruit-circuitpython-vl53l0x (sensor).
  • Not yet on PyPI — install from source: pip install -e . (add .[pyserial] / .[sensor] for extras).