]>
vault307.fbx.one Git - random.git/blob - ledStranRAND.py
2 from machine
import Pin
3 from neopixel
import NeoPixel
10 # Define the strand pin number and number of LEDs from variables
11 strand
= NeoPixel(Pin(GPIOnumber
), LEDcount
)
13 # Turn off all LEDs before program start
19 mycolour
= random
.randint(0,256),random
.randint(0,256),random
.randint(0,256)
21 for i
in range(LEDcount
):
23 strand
[i
] = (mycolour
)
26 # Show the light for this long
29 #Clear the strand at the end of each loop
33 for i
in reversed (range(LEDcount
)):
37 # Show the light for this long
40 #Clear the strand at the end of each loop