Categories
Classes Projects

Make a Color-Changing Silhouette Light

Onboard NeoPixels:
Change colors

import board
import neopixel
from time import sleep

RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
PURPLE = (128, 0, 128)

NUM_LEDS = 10
PIXEL_PIN = board.D8

np = neopixel.NeoPixel(PIXEL_PIN, NUM_LEDS)

while True:
np.fill(RED)
sleep(0.5)
np.fill(GREEN)
sleep(0.5)
np.fill(BLUE)
sleep(0.5)
np.fill(PURPLE)
sleep(0.5)