-
Notifications
You must be signed in to change notification settings - Fork 2
/
cheap_iron_man.py
90 lines (73 loc) · 1.57 KB
/
cheap_iron_man.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
from adafruit_circuitplayground.express import cpx
from time import sleep
import random
pix = cpx.pixels
def start(x):
pix[x] = (3,3,3)
sleep(1)
pix[x] = (0,0,0)
sleep(1)
pix[x] = (50,50,50)
sleep(0.5)
pix[x] = (0,0,0)
sleep(0.5)
pix[x] = (20,20,20)
sleep(0.2)
pix[x] = (1,1,1)
sleep(0.5)
pix[x] = (100,100,100)
sleep(0.1)
pix[x] = (0,0,0)
sleep(0.1)
for _x in range(0,256):
pix[x] = (_x,_x,_x)
sleep(0.005)
start(0)
start(4)
start(7)
pix[0],pix[4],pix[7] = (255,255,255),(255,255,255),(255,255,255)
sl = 1.0
for x in range(0,10):
pix[x] = (255,255,255)
sleep(sl)
sl -= 0.1
pix[x] = (0,0,0)
sl = 0.1
for x in range(0,10):
pix[x] = (255,255,255)
sleep(sl)
sl -= 0.01
pix[x] = (0,0,0)
sl = 0.01
for x in range(0,10):
pix[x] = (255,255,255)
sleep(sl)
sl -= 0.0001
pix[x] = (0,0,0)
for _ in range(5):
sl = 0.0001
for x in range(0,10):
pix[x] = (255,255,255)
sleep(sl)
sl -= 0.00001
pix[x] = (0,0,0)
for _ in range(10):
sl = 0.0001
for x in range(0,10):
pix[x] = (255,255,255)
sleep(sl)
sl -= 0.00001
pix[x] = (0,0,0)
for _ in range(5):
pix.fill((random.randint(0,255),random.randint(0,255),random.randint(0,255)))
pix.fill((255,255,255))
pix.brightness = 0.4
sleep(2)
while True:
for x in range(1,10):
pix.brightness = x/10.
sleep(0.1)
for x in range(0,10):
x = 10 - x
pix.brightness = x/10.
sleep(0.1)