from machine import Pin
from neopixel import NeoPixel
from time import sleep
def light_ring(ring, color, start, count, time):
for i in range(start, start+count):
ring[i] = color
ring.write()
sleep(time)
led_in_np = 12
np_pin = Pin(13, Pin.OUT)
np = NeoPixel(np_pin, led_in_np)
r = [255, 0, 0]
g = [0, 255, 0]
b = [0, 0, 255]
off = [0, 0, 0]
colors = [r, g, b]
while True:
for nm,c in enumerate(colors):
light_ring(np, c, 4 * nm, 4, 1)
light_ring(np, off, 0, led_in_np, 1)