File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ import board
2
+ import neopixel
3
+ import adafruit_dotstar
4
+
5
+ LED = adafruit_dotstar .DotStar (board .APA102_SCK , board .APA102_MOSI , 1 ) #Setup Internal Dotar
6
+ LED .brightness = 0.8 #DotStar brightness
7
+
8
+ NUMPIX = 7 # Number of NeoPixels
9
+ PIXPIN = board .D2 # Pin where NeoPixels are connected
10
+ PIXELS = neopixel .NeoPixel (PIXPIN , NUMPIX ) # NeoPixel object setup
11
+
12
+ RED = 7 #Number of pixels to be red
13
+ BLUE = 0 #First pixel
14
+
15
+ while True : # Loop forever...
16
+ #Make the internal dotstar light up.
17
+ LED [0 ] = (100 , 0 , 255 )
18
+
19
+ #Select these pixels starting with the second pixel.
20
+ for i in range (1 , RED ):
21
+ # Make the pixels red
22
+ PIXELS [i ] = (100 , 0 , 0 )
23
+
24
+ #Make the first neopixel this color
25
+ PIXELS [BLUE ] = (0 , 0 , 100 )
You can’t perform that action at this time.
0 commit comments