#!/usr/bin/env python3 import uasyncio as asyncio from machine import WDT from settings import Settings from patterns import Patterns async def main(): s = Settings() pin = s.get("led_pin", 10) num = s.get("num_leds", 30) p = Patterns(pin=pin, num_leds=num) wdt = WDT(timeout=10000) p.set_param("br", 64) p.set_param("dl", 120) p.set_param("cl", [(255, 0, 0), (0, 0, 255)]) p.select("on") task = asyncio.create_task(p.run()) await asyncio.sleep_ms(800) p.stopped = True await task p.stopped = False p.select("off") task = asyncio.create_task(p.run()) await asyncio.sleep_ms(100) p.stopped = True await task if __name__ == "__main__": asyncio.run(main())