-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
131 lines (125 loc) · 4.38 KB
/
test.py
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
from educore import rgb, button
import time
def sendfunctiona():
numbers = [0, 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]
pxs.write(index=numbers, r=0, g=0, b=0)
def sendfunctionb():
global pxs
pxs.write(index=[0, 1], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[2, 3], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[3, 4], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[4, 5], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[5, 6], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[6, 7], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[7, 8], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[8, 9], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[9, 10], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[10, 11], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[11, 12], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[12, 13], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[13, 14], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[14, 15], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[15, 16], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[16, 17], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[17, 18], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[18, 19], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[19, 20], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[21, 22], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[22, 23], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[23, 24], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[24, 25], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[25, 26], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[26, 27], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[27, 28], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[28, 29], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[29, 30], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[30, 31], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[31, 32], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[32, 33], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[33, 34], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[34, 35], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[35, 36], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[36, 37], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[37, 38], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[38, 39], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[39, 40], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[40, 41], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[41, 42], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[42, 43], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[43, 44], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[44, 45], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[45, 46], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[46, 47], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[47, 48], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[48, 49], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[49, 50], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[50, 51], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[51, 52], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[52, 53], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[53, 54], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[54, 55], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[55, 56], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[56, 57], r=255, g=69, b=0)
time.sleep_ms(50)
pxs.write(index=[57, 58, 59], r=255, g=69, b=0)
pxs = rgb(15, num=60)
a = button(button.a) # 使用板载则放入button.a或者button.b
b = button(button.b)
a.event_pressed = sendfunctiona
b.event_pressed = sendfunctionb