File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Circuit_Playground_Brake_Light Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 13
13
i = 0
14
14
cp .pixels .fill ((255 , 0 , 0 ))
15
15
16
- sleep = False
16
+ light_on = False
17
17
18
18
while True :
19
19
x , y , z = cp .acceleration
38
38
if not cp .shake (shake_threshold = 10 ):
39
39
cp .pixels .brightness = 1
40
40
start = time .monotonic ()
41
- sleep = True
41
+ light_on = True
42
42
i += 1
43
43
44
- # sleep variable is for short circuiting. Not really necessary, but it makes things run faster
45
- elif not sleep or time .monotonic () - start > 0.4 :
44
+ # light_on variable is for short circuiting. Not really necessary, but it makes things run faster
45
+ elif not light_on or time .monotonic () - start > 0.4 :
46
46
# Sine wave used for the color breathing effect.
47
47
# Max brightness can be adjusted with the coefficient.
48
48
cp .pixels .brightness = abs (math .sin (brightness )) * 0.5
49
49
brightness += 0.05
50
50
i = 0
51
- sleep = False
51
+ light_on = False
52
52
53
53
time .sleep (0.02 )
You can’t perform that action at this time.
0 commit comments