Add led test
This commit is contained in:
32
pico/test/leds.py
Normal file
32
pico/test/leds.py
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
from ws2812 import WS2812B
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# --- Rainbow pattern (outside ws2812): pregen double buffer, show via head offset ---
|
||||||
|
|
||||||
|
|
||||||
|
# --- Strips + rainbow buffers per strip ---
|
||||||
|
|
||||||
|
strips = []
|
||||||
|
pins = ((2, 291),
|
||||||
|
(3, 290),
|
||||||
|
(4, 283),
|
||||||
|
(7, 278),
|
||||||
|
(0, 275),
|
||||||
|
(28, 278),
|
||||||
|
(29, 283),
|
||||||
|
(6, 290))
|
||||||
|
|
||||||
|
sm = 0
|
||||||
|
|
||||||
|
for pin, num_leds in pins:
|
||||||
|
print(pin, num_leds)
|
||||||
|
ws = WS2812B(num_leds, pin, sm, brightness=1.0) # 1.0 so fill() is visible
|
||||||
|
strips.append(ws)
|
||||||
|
sm += 1
|
||||||
|
ws.fill((255,0,0))
|
||||||
|
ws.show()
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user