-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_SPI.py
More file actions
64 lines (51 loc) · 1.13 KB
/
test_SPI.py
File metadata and controls
64 lines (51 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/python3
# minimal test for NeoPixels on Raspberry Pi
import time
import board
import neopixel_spi
num_pixels = 24
pixels = neopixel_spi.NeoPixel_SPI(
board.SPI(),
num_pixels,
bpp=4,
brightness=0.5,
auto_write=False,
pixel_order=neopixel_spi.GRBW,
bit0=0b10000000)
while True:
print('red')
pixels.fill((255, 0, 0, 0))
pixels.show()
time.sleep(2)
print('green')
pixels.fill((0, 255, 0, 0))
pixels.show()
time.sleep(2)
print('blue')
pixels.fill((0, 0, 255, 0))
pixels.show()
time.sleep(2)
print('white')
pixels.fill((0, 0, 0, 255))
pixels.show()
time.sleep(2)
#print('rgb full')
#pixels.fill((255, 255, 255, 0))
#pixels.show()
#time.sleep(2)
#print('rgbw 10')
#pixels.fill((10, 10, 10, 10))
#pixels.show()
#time.sleep(2)
#print('rgb 1, w 100')
#pixels.fill((1, 1, 1, 100))
#pixels.show()
#time.sleep(2)
#print('rgb 1, w 255')
#pixels.fill((1, 1, 1, 255))
#pixels.show()
#time.sleep(2)
#print('b 1, w 100')
#pixels.fill((0, 0, 1, 100))
#pixels.show()
#time.sleep(2)