Import led-driver app: pico/ and esp32/ layout

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-19 18:14:17 +13:00
parent 86b28a1b9c
commit 0c73d56ab5
31 changed files with 2907 additions and 54 deletions

30
pico/test/patterns/off.py Normal file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env python3
import utime
from machine import WDT
from settings import Settings
from presets import Presets
def main():
s = Settings()
pin = s.get("led_pin", 10)
num = s.get("num_leds", 30)
p = Presets(pin=pin, num_leds=num)
wdt = WDT(timeout=10000)
# Create an "off" preset (use short-key field `p` for pattern)
p.edit("test_off", {"p": "off"})
p.select("test_off")
start = utime.ticks_ms()
while utime.ticks_diff(utime.ticks_ms(), start) < 200:
wdt.feed()
p.tick()
utime.sleep_ms(10)
if __name__ == "__main__":
main()