from machine import Pin
from neopixel import NeoPixel
import time
pin = Pin(23, Pin.OUT)
np = NeoPixel(pin, 8)
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[2] = color[a]
np[3] = color[a]
np[4] = color[a]
np[5] = color[a]
np[6] = color[a]
np[7] = color[a]
np.write()
time.sleep(4)
except KeyboardInterrupt:
np[0] = (0,0,0)
np.write()