-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample.py
34 lines (26 loc) · 899 Bytes
/
example.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
import mled, animations
class Example:
boards = {
'd1_mini': (13, 14),
'mh_et_live_minikit': (23, 18)
}
def main(self, model):
self.matrix = mled.driver(self.boards[model][0], self.boards[model][1])
self.test()
self.animate()
def test(self):
self.matrix.clear()
self.matrix.setIntensity(7)
for y in range(0, 8):
for x in range(0, 8):
self.matrix.pixel(x, y, self.matrix.ON)
self.matrix.display()
for y in range(0, 8):
for x in range(0, 8):
self.matrix.pixel(x, y, self.matrix.OFF)
self.matrix.display()
def animate(self):
ani = mled.animation(self.matrix)
ani.loop(0, 33, animations.ani_heart_pulse + animations.ani_pacman_pulse + animations.ani_ghost_pulse)
app = Example()
app.main('d1_mini')