feat(simulator): add GUI runner, stubs, and workspace assets

Add host simulator scaffolding, examples, and docs so led-driver main can run end-to-end with MicroPython module stubs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-04 22:48:54 +12:00
parent 7ce56b64df
commit 42c14361e8
20 changed files with 513 additions and 0 deletions

19
examples/blink.py Normal file
View File

@@ -0,0 +1,19 @@
"""Example pattern for led-simulator / led-driver (generator + yield per tick)."""
import utime
class Blink:
def __init__(self, presets):
self.presets = presets
def run(self, preset):
colors = preset.c if preset.c else [(255, 255, 255)]
idx = 0
delay_ms = max(1, int(preset.d))
while True:
rgb = colors[idx % len(colors)]
self.presets.fill(self.presets.apply_brightness(rgb, preset.b))
yield
utime.sleep_ms(delay_ms)
idx += 1