Update to match the new patterns format
This commit is contained in:
13
src/main.py
13
src/main.py
@@ -17,15 +17,7 @@ async def main():
|
||||
patterns = Patterns(settings["led_pin"], settings["num_leds"], selected=settings["pattern"])
|
||||
if settings["color_order"] == "rbg": color_order = (1, 5, 3)
|
||||
else: color_order = (1, 3, 5)
|
||||
patterns.set_color1(tuple(int(settings["color1"][i:i+2], 16) for i in color_order))
|
||||
patterns.set_color2(tuple(int(settings["color2"][i:i+2], 16) for i in color_order))
|
||||
patterns.set_brightness(int(settings["brightness"]))
|
||||
patterns.set_delay(int(settings["delay"]))
|
||||
|
||||
async def tick():
|
||||
while True:
|
||||
patterns.tick()
|
||||
await asyncio.sleep_ms(0)
|
||||
patterns.colors = [(8,0,0)]
|
||||
|
||||
async def system():
|
||||
while True:
|
||||
@@ -42,9 +34,10 @@ async def main():
|
||||
wdt = machine.WDT(timeout=10000)
|
||||
wdt.feed()
|
||||
|
||||
asyncio.create_task(tick())
|
||||
asyncio.create_task(p2p(settings, patterns))
|
||||
asyncio.create_task(system())
|
||||
patterns.select(settings["pattern"])
|
||||
await patterns.run()
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user