Skip to content

Instantly share code, notes, and snippets.

@sethcohn
Created August 10, 2017 23:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sethcohn/027eefd6c9afd363f545a00a4234057a to your computer and use it in GitHub Desktop.
Save sethcohn/027eefd6c9afd363f545a00a4234057a to your computer and use it in GitHub Desktop.
Quick and dirty fire for neopixels in circuitpython
# not a great one, but it works, and it's tweakable. You'll need to add imports and tweak values
strand = neopixel.NeoPixel(NEOPIXEL, 10, 3, 1, False)
while True:
r = 226
g = 121
b = 35
#Flicker, based on our initial RGB values
for i in range (0, len(strand)):
flicker = urandom.randint(0,110)
r1 = bounds(r-flicker, 0, 255)
g1 = bounds(g-flicker, 0, 255)
b1 = bounds(b-flicker, 0, 255)
strand[i] = (r1,g1,b1)
strand.show()
time.sleep(urandom.randint(100,1000) / 3000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment