-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (22 loc) · 666 Bytes
/
Copy pathmain.py
File metadata and controls
30 lines (22 loc) · 666 Bytes
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
from sense_hat import SenseHat
import time
import sensible_colours
from ghost_blinky import blinky_frames
def fill_pixels(the_sense_hat, the_animation):
the_sense_hat.low_light = True
num_frames = len(the_animation)
count = 0
while True:
pixels = the_animation[count % num_frames]
the_sense_hat.set_pixels(pixels)
time.sleep(1 / 4)
count += 1
if __name__ == '__main__':
# Initialise the SenseHAT and clear the LED matrix
sense = SenseHat()
sense.clear([0, 0, 0])
sense.low_light = True
frames = []
for frame in blinky_frames:
frames.append(frame)
fill_pixels(sense, frames)