-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathTeam Pixels.py
60 lines (52 loc) · 1.53 KB
/
Team Pixels.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
# Write your code here :-)
from adafruit_circuitplayground.express import cpx
from time import sleep
cpx.pixels.brightness=.3
while True:
x,y,z = cpx.acceleration
print((x, y, z))
sleep(.2)
if y <10 and y>7 :
cpx.pixels[3] = (120, 2, 90)
cpx.pixels[4] = (120, 2, 90)
cpx.pixels[5] = (120, 2, 90)
cpx.pixels[6] = (120, 2, 90)
cpx.pixels[1] = (0,0,0)
cpx.pixels[2] = (0,0,0)
cpx.pixels[7] = (0,0,0)
cpx.pixels[8] = (0,0,0)
cpx.pixels[9] = (0,0,0)
cpx.pixels[0] = (0,0,0)
if y < 5 and y>1 :
cpx.pixels[3] = (120, 2, 90)
cpx.pixels[4] = (120, 2, 90)
cpx.pixels[5] = (120, 2, 90)
cpx.pixels[2] = (120, 2, 90)
cpx.pixels[1] = (0,0,0)
cpx.pixels[6] = (0,0,0)
cpx.pixels[7] = (0,0,0)
cpx.pixels[8] = (0,0,0)
cpx.pixels[9] = (0,0,0)
cpx.pixels[0] = (0,0,0)
if y < 0 and y>-2 :
cpx.pixels[3] = (120, 2, 90)
cpx.pixels[4] = (120, 2, 90)
cpx.pixels[2] = (120, 2, 90)
cpx.pixels[1] = (120, 2, 90)
cpx.pixels[5] = (0,0,0)
cpx.pixels[6] = (0,0,0)
cpx.pixels[7] = (0,0,0)
cpx.pixels[8] = (0,0,0)
cpx.pixels[9] = (0,0,0)
cpx.pixels[0] = (0,0,0)
if y < -4 and y>-8 :
cpx.pixels[3] = (120, 2, 90)
cpx.pixels[0] = (120, 2, 90)
cpx.pixels[2] = (120, 2, 90)
cpx.pixels[1] = (120, 2, 90)
cpx.pixels[5] = (0,0,0)
cpx.pixels[6] = (0,0,0)
cpx.pixels[7] = (0,0,0)
cpx.pixels[8] = (0,0,0)
cpx.pixels[9] = (0,0,0)
cpx.pixels[4] =(0,0,0)