import machine
import neopixel
import time
# Initialize LED strip on GPIO6 with 8 LEDs
LED_pin = machine.Pin(6)
LED_chain = neopixel.NeoPixel(LED_pin, 8)
# Define colors (R, G, B)
colors = [(255, 0, 0), # Red
(0, 255, 0), # Green
(0, 0, 255), # Blue
(255, 255, 255)] # White
# Loop through colors with 1-second delay
for color in colors:
for i in range(8): # Apply color to all LEDs
LED_chain[i] = color
LED_chain.write() # Update LED strip
time.sleep(1) # Hold for 1 second -> delay
# Turn off all LEDs
for i in range(8):
LED_chain[i] = (0, 0, 0) # Set to black (off)
LED_chain.write()