from machine import Pin
from utime import sleep
from neopixel import NeoPixel
sleep(0.1)
led2=NeoPixel(Pin(20), 16)
def blink_1():
for j in range(16):
for i in range(16):
led2[i] = (255, 255, 255) # set the first pixel to white
led2[j]=(255, 0, 0)
if j<15:
led2[j+1]=(255, 0, 0)
else:
led2[0]=(255, 0, 0)
led2.write() # write data to all pixels
sleep(0.3)
def blink_2():
for i in range(16):
led2[i] = (255, 255, 255) # set the first pixel to white
led2.write()
sleep(0.3)
for i in range(16):
led2[i] = (0, 255, 0) # set the first pixel to white
led2.write()
sleep(0.3)
while 1:
for i in range(3):
print(i)
blink_1()
for i in range(10):
print(i)
blink_2()