Skip to content

Instantly share code, notes, and snippets.

@RajanRao12
Created May 6, 2022 22:37
Show Gist options
  • Select an option

  • Save RajanRao12/ae032f3234eedc716e3d5a539f62c480 to your computer and use it in GitHub Desktop.

Select an option

Save RajanRao12/ae032f3234eedc716e3d5a539f62c480 to your computer and use it in GitHub Desktop.
Organic Light pattern
import time
import board
import neopixel
pixel_pin = board.D2
num_pixels = 12
pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=0.5, auto_write=False)
ROBIN = (222,35,5)
ROBINDIM = (111,18,3)
ROBINDIMMER = (56,12,2)
ROBINDIMMEST = (28,6,1)
OFF = (0,0,0)
while True:
for i in range(0,12,1):
pixels[i]=OFF
pixels.show()
time.sleep(0.1)
pixels[i-1]=ROBINDIMMEST
pixels.show()
time.sleep(0.1)
pixels[i-2]=ROBINDIMMER
pixels.show()
time.sleep(0.1)
pixels[i-3]=ROBINDIM
pixels.show()
time.sleep(0.1)
pixels[i-4]=ROBIN
pixels.show()
time.sleep(0.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment