Files
python-editor/workspace/code/pattern_twinkle_demo.py
jimmy e4c811f51d Expand browser editor runtime and LED simulation workflows.
Add Docker deployment support, richer Selenium/LED pattern tests, in-browser diagnostics, responsive UI improvements, and 16x16 panel simulation tooling to speed iteration and hardware-style prototyping.

Made-with: Cursor
2026-05-01 20:24:05 +12:00

27 lines
494 B
Python

"""Twinkle pattern demo using led_patterns helpers."""
from machine import Pin
import neopixel
import time
from led_patterns import twinkle_frame
np = neopixel.NeoPixel(Pin(4), 36)
for frame in range(120):
frame_colors = twinkle_frame(
len(np),
frame,
base=(0, 0, 6),
sparkle=(255, 210, 130),
sparkles=5,
)
for i, color in enumerate(frame_colors):
np[i] = color
np.write()
time.sleep(0.08)
np.fill((0, 0, 0))
np.write()