Skip to content

Instantly share code, notes, and snippets.

@lizzybrooks
Created January 26, 2026 19:16
Show Gist options
  • Select an option

  • Save lizzybrooks/7311ab3e2caf2a2b0f37cdcd850a9f6f to your computer and use it in GitHub Desktop.

Select an option

Save lizzybrooks/7311ab3e2caf2a2b0f37cdcd850a9f6f to your computer and use it in GitHub Desktop.
import time
import board
import neopixel
pixel_pin = board.D2 #the ring data is connected to this pin
num_pixels = 16 #number of leds pixels on the ring
pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=0.3, auto_write=False)
RED = (255, 0, 0) #RGB
YELLOW = (255, 150, 0)
GREEN = (0, 255, 0)
CYAN = (0, 255, 255)
BLUE = (0, 0, 255)
PURPLE = (180, 0, 255)
WHITE = (255, 255, 255)
OFF = (0, 0, 0)
Peri = (30,30,30)
while True:
pixels.fill(Peri)
pixels.show() #required to update pixels
time.sleep(1)
pixels.fill(GREEN)
pixels.show()
time.sleep(1)
pixels.fill(BLUE)
pixels.show()
time.sleep(1)
pixels.fill(WHITE)
pixels.show()
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment