-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.py
52 lines (37 loc) · 1.26 KB
/
demo.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
import ioled_lib, time
strip = ioled_lib.LedStrip("{IP_ADDRESS}", 2712)
strip.sendRainbow(500, 0.3)
time.sleep(2)
strip.color(255, 0, 0).brightness(0.4).addRange(0, 4).color(0, 255, 0).addRange(4, 8).color(0, 0, 255).addRange(8, 12).send()
time.sleep(2)
strip.color(255, 0, 0).addRange(0, 12).send()
time.sleep(2)
strip.color(0, 255, 0).addRange(0, 12).send()
time.sleep(2)
strip.color(0, 0, 255).addRange(0, 12).send()
time.sleep(2)
bns = []
for i in range(0, 20):
bns.append(i*0.05)
for x in range(0, 2):
for i in range(0, len(bns)):
strip.color(255, 0, 0).brightness(bns[i]).addRange(0, 12).send()
time.sleep(0.1)
for i in range(0, len(bns)):
strip.color(255, 0, 0).brightness(bns[len(bns)-1-i]).addRange(0, 12).send()
time.sleep(0.1)
for i in range(0, 12):
strip.color(255, 0, 0).brightness(0.5).addLed(i).send()
time.sleep(0.1)
for i in range(0, 12):
strip.color(0, 255, 0).addLed(i).send()
time.sleep(0.1)
for i in range(0, 12):
strip.color(0, 0, 255).addLed(i).send()
time.sleep(0.1)
strip.color(0, 0, 0).addRange(0, 12).send()
for j in range(0, 20):
for i in range(0, 12):
strip.color(0, 0, 255).addLed(i).send()
time.sleep(0.05)
strip.color(0, 0, 0).addLed(i).send()