Created
December 5, 2017 17:20
-
-
Save sat0ken/777af058d1d68ad02395b9c804057f9d to your computer and use it in GitHub Desktop.
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
from machine import Pin | |
from neopixel import NeoPixel | |
import time, random | |
np = NeoPixel(Pin(5), 20, bpp=3) | |
step = 32 | |
def light_on(): | |
while True: | |
for i in range(20): | |
for j in range(20): | |
np[j] = tuple(( max(0, val - step) for val in np[j])) | |
r = random.randint(0, 255) | |
g = random.randint(0, 255) | |
b = random.randint(0, 255) | |
np[i] = (r, g, b) | |
np.write() | |
time.sleep(0.05) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment