Created
August 10, 2017 23:46
-
-
Save sethcohn/027eefd6c9afd363f545a00a4234057a to your computer and use it in GitHub Desktop.
Quick and dirty fire for neopixels in circuitpython
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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