MicroPython sim that runs on https://wokwi.com/pi-pico: KY-040 encoder stands in for the thumb-roller (rotate=tempo, press=start/stop, hold+rotate=track), an SSD1306 OLED for the display, and a piezo buzzer for the click. Files: diagram.json, main.py, ssd1306.py + README with the (manual) setup steps. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __pycache__ | ||
| diagram.json | ||
| main.py | ||
| README.md | ||
| ssd1306.py | ||
Wokwi simulation — PM‑µ Micro (Raspberry Pi Pico)
A runnable Wokwi simulation of the PM‑µ Micro metronome on a Raspberry Pi Pico (RP2040), in MicroPython. It's a functional stand‑in — Wokwi has no 14‑segment display or analog audio path, so we approximate:
| Real device | Simulated with |
|---|---|
| Clickable thumb‑roller | KY‑040 rotary encoder (rotate / press / hold+rotate) |
| Amber 14‑segment display | SSD1306 OLED (shows BPM and track names) |
| Analog click + speaker | Piezo buzzer (accent beat = higher, longer beep) |
Controls
- Rotate the encoder → tempo (BPM)
- Press (the encoder's button) → start / stop
- Hold the button + rotate → switch track (release to load it)
Run it (you do this part — I can't operate your Wokwi account)
I can't log into wokwi.com or create the project on the site for you. Use these files:
- Open https://wokwi.com/pi-pico — it starts a new Pi Pico MicroPython project.
- Click the
diagram.jsontab and replace its contents with this folder'sdiagram.json. - Replace
main.pywith this folder'smain.py. - Add a new file named
ssd1306.py(the + next to the file tabs) and paste this folder'sssd1306.py. - Press ▶ (play). Rotate / click the encoder; you'll hear the click and see the OLED update.
If you use the Wokwi VS Code extension instead, keep these three files together and add a
diagram.jsonreference as usual.
Pin map (Pico GPIO)
| Function | Pin |
|---|---|
| OLED SDA / SCL (I²C0) | GP0 / GP1 |
| Encoder CLK / DT / SW | GP2 / GP3 / GP4 |
| Buzzer | GP5 |
| OLED + encoder power | 3V3 / GND |
The real firmware ("PORTS TO FIRMWARE" in the web app) drives a 14‑segment display over I²C and injects the click into the analog signal path; this sim keeps the same control model and beat scheduling so the feel matches.