# NeoPixel driver demo, Use the neopixel module
from machine import Pin
from neopixel import NeoPixel
import time
pin = Pin(14, Pin.OUT) # set GPIO0 to output to drive NeoPixels
np = NeoPixel(pin, 16) # create NeoPixel driver on GPIO0 for 8 pixels
# np[0] = (255, 255, 255) # set the first pixel to white with low intensity
# np[1] = (255, 0, 0) # set the second pixel to red with low intensity
# np[2] = (0, 255, 0) # set the third pixel to green with low intensity
# np[3] = (0, 0, 255) # set the fourth pixel to blue with low intensity
# np[4] = (255, 255, 0) # set the fifth pixel to yello with low intensity
# np.write()
while True:
for i in range(16):
np[i] = (255,0,0)
np.write()
time.sleep(0.5)
# i = 0
# while i < 256:
# np[0] = (i,0,0)
# np.write()
# time.sleep(0.01)
# i += 1
# time.sleep(2)
# i = 0
# while i < 256:
# np[0] = (256-i,0,0)
# np.write()
# time.sleep(0.01)
# i += 1
# # R = int(input("geef een R>"))
# # G = int(input("geef een G>"))
# # B = int(input("geef een B>"))
# # for _ in range(16):
# # np[_] = (R,G,B)
# # np.write()
# # RGB = input("geef een RGB (R,G,B)>")
# # RGB_list = RGB.split(",")
# for _ in range(16):
# np[_] = (int(RGB_list[0]),int(RGB_list[1]),int(RGB_list[2]))
# np.write()