feat(patterns): add icicles blizzard and rime winter effects
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
43
tests/patterns/icicles.py
Normal file
43
tests/patterns/icicles.py
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env python3
|
||||
import utime
|
||||
from machine import WDT
|
||||
from settings import Settings
|
||||
from presets import Presets
|
||||
|
||||
|
||||
def run_for(p, wdt, ms):
|
||||
start = utime.ticks_ms()
|
||||
while utime.ticks_diff(utime.ticks_ms(), start) < ms:
|
||||
wdt.feed()
|
||||
p.tick()
|
||||
utime.sleep_ms(10)
|
||||
|
||||
|
||||
def main():
|
||||
s = Settings()
|
||||
p = Presets(pin=s.get("led_pin", 10), num_leds=s.get("num_leds", 40))
|
||||
wdt = WDT(timeout=10000)
|
||||
|
||||
p.edit(
|
||||
"test_icicles",
|
||||
{
|
||||
"p": "icicles",
|
||||
"b": 220,
|
||||
"d": 50,
|
||||
"c": [(200, 230, 255), (255, 255, 255)],
|
||||
"n1": 10,
|
||||
"n2": 8,
|
||||
"n3": 1,
|
||||
"a": True,
|
||||
},
|
||||
)
|
||||
p.select("test_icicles")
|
||||
run_for(p, wdt, 2500)
|
||||
|
||||
p.edit("cleanup_off", {"p": "off"})
|
||||
p.select("cleanup_off")
|
||||
run_for(p, wdt, 80)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user