from machine import Pin
from neopixel import NeoPixel
import time
pin = Pin(23, Pin.OUT)
np = NeoPixel(pin, 2)
color = {"1": (255,255,0),"2": (255,0,0),"3":(0, 255, 0)}
try:
while True:
for a in sorted(color):
print(a, color[a])
np[0] = color[a]
np[1] = color[a]
np.write()
time.sleep(4)
except KeyboardInterrupt:
np[0] = (0,0,0)
np.write()