line 36 move outside for loop

the strip turns the pixel off before it fades out, so moving the strip outside the for loop lets the fade out happen, then turns the pixel off.
This commit is contained in:
ntg081 2019-12-30 10:56:55 -05:00 committed by GitHub
parent 1e8fe9b8aa
commit 8ccfefa4c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,9 +33,8 @@ def flash_random(wait, howmany):
for i in range(5, 0, -1):
strip.brightness = i / 5.0 # Ramp down brightness
strip[j] = [0, 0, 0] # Set pixel to 'off'
time.sleep(wait)
strip[j] = [0, 0, 0] # Set pixel to 'off'
while True:
# first number is 'wait' delay, shorter num == shorter twinkle