Adds pico-explorer/ as a parallel CircuitPython firmware target alongside the 52Pi
Kit in pico-cp/. Same engine, same program-string grammar, same programs.json, same
live-sync protocol. Read-only on the device (no on-device beat editing); the web
editor's Live sync mirrors all edits in real time and the Explorer emits its own
play/stop/bpm/sel deltas back.
Hardware (Pimoroni Explorer PIM744):
- RP2350B + 2.8" ST7789V 320x240 LCD (8-bit parallel; CircuitPython's official
board definition pre-builds the BusDisplay so we just use board.DISPLAY).
- 6 user buttons - A/B/C on the left of the screen, X/Y/Z on the right.
- Piezo speaker on GP12 (PWM) with amp enable on GP13.
- I2C QwSTEMMA on GP20/21 - reserved, unused by the firmware.
- No touchscreen, no joystick, no RGB LED. Run state shows on a tiny on-screen dot.
Buttons:
- A = play/stop. B = tap tempo. C = menu.
- X = prev track (hold-repeat). Z = next track (hold-repeat).
- Y = tempo -1 (hold-repeat; -5 after 1.5s).
- X+Z chord = tempo +1 (mirrors Y).
- In a menu: X/Z move the row cursor, Y decrements, A cycles/increments/selects,
B = back, C = close.
Files added:
- pico-explorer/{boot.py, code.py, app.py, programs.json, README.md}.
app.py = 1444 lines (~73KB source -> 29.8KB compiled .mpy).
- info-explorer.html.
Files touched:
- pico-cp/app.py: bump to 0.0.23. Version-query (SysEx 0x02 -> 0x03) reply now
includes the device id as "K;<version>" (backward-compat: editor parses
"contains ';'?" - old firmware sent bare version, treated as K).
- editor.html + editor-beta.html: _parseDeviceReply() splits id;version, FW_PATHS
maps id to .py/.mpy URL pair, so Update firmware now pushes the right binary.
- build.sh + deploy.sh: precompile pico-explorer/app.py -> dist/explorer-app.mpy,
zip pm_x1_circuitpy.zip alongside pm_k1_circuitpy.zip, ship
pico-explorer-app.{py,mpy} next to pico-cp-app.{py,mpy}.
- docs/livesync-protocol.md: new section 7 - per-device emit/apply matrix.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
22 lines
1.1 KiB
Python
22 lines
1.1 KiB
Python
# boot.py - runs once at power-on (before USB connects); decides who owns the filesystem.
|
|
#
|
|
# DEFAULT = appliance mode: the FIRMWARE owns the drive, so it can save your practice log to
|
|
# /history.json and write /programs.json that the editor pushes over USB-MIDI. The drive is then
|
|
# READ-ONLY to the computer - which also protects the firmware from accidental deletion.
|
|
#
|
|
# HOLD BUTTON A (GP16 on the Pimoroni Explorer) WHILE PLUGGING IN = editor mode: the drive is
|
|
# writable by the computer, so you can drag programs.json / code.py on from any OS or browser
|
|
# (the universal fallback). Reset afterwards to return to appliance mode.
|
|
#
|
|
# Also frees a USB endpoint (disables unused HID) and makes sure USB-MIDI is available.
|
|
import board, digitalio, storage, usb_hid, usb_midi
|
|
try: usb_hid.disable()
|
|
except Exception: pass
|
|
usb_midi.enable()
|
|
a = digitalio.DigitalInOut(board.GP16)
|
|
a.switch_to_input(pull=digitalio.Pull.UP)
|
|
appliance = a.value # value True (pull-up, not pressed) -> appliance mode
|
|
a.deinit()
|
|
if appliance:
|
|
try: storage.remount("/", readonly=False) # writable by code, read-only to the computer
|
|
except Exception: pass
|