-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmission-zero.py
40 lines (34 loc) · 988 Bytes
/
mission-zero.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
from sense_hat import SenseHat
from time import sleep
# Set up the Sense HAT
sense = SenseHat()
sense.set_rotation(270, False)
# Set up the colour sensor
sense.color.gain = 60 # Set the sensitivity of the sensor
sense.color.integration_cycles = 64 # The interval at which the reading will be taken
# Add colour variables and image
# Display the image
c = (100, 149, 237) # CornflowerBlue
a = (255, 255, 255) # White
v = (255, 0, 0) # Red
t = (255, 140, 0) # DarkOrange
q = (255, 255, 0) # Yellow
l = (0, 255, 127) # SpringGreen
e = (0, 0, 205) # MediumBlue
image = [
c, c, c, c, c, c, c, c,
v, v, v, v, c, c, c, c,
t, t, t, t, v, v, c, c,
q, q, q, q, t, v, c, c,
l, l, l, l, q, t, v, c,
e, e, e, l, q, t, v, c,
c, c, e, a, a, a, a, c,
c, a, a, a, a, a, a, a
]
orientation = 1
for i in range(10):
rgb = sense.color
image[:8] = 8 * [(rgb.red, rgb.green, rgb.blue), ]
orientation = orientation * -1
sense.set_pixels(image[::orientation])
sleep(0.5)