# NeoPixels Rainbow on MicroPython
# Wokwi Example https://wokwi.com/arduino/projects/305569065545499202
from machine import Pin
from neopixel import NeoPixel
from time import sleep
rainbow = [
(126 , 1 , 0),(114 , 13 , 0),(102 , 25 , 0),(90 , 37 , 0),(78 , 49 , 0),(66 , 61 , 0),(54 , 73 , 0),(42 , 85 , 0),
(255 , 0 , 0),(0 , 255 , 0),(0 , 0 , 255),(255, 255 , 0),(255, 255 , 255),(66 , 255 , 255),(255, 0 , 255),(42 , 85 , 0),
(255 , 0 , 0),(0 , 255 , 0),(0 , 0 , 255),(255, 255 , 0),(255, 255 , 255),(66 , 255 , 255),(255, 0 , 255),(42 , 85 , 0),
]
pixels = NeoPixel(Pin(15), 16)
while True:
rainbow = rainbow[-1:] + rainbow[:-1]
for i in range(16):
pixels[i] = rainbow[i]
pixels.write()
sleep(0.1)