forked from CodeNextAdmin/Raspimon_Academy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
raspimon_moves.py
34 lines (26 loc) · 852 Bytes
/
raspimon_moves.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
from pathlib import Path
import sys
p = Path().absolute() #get path to parent dir
sys.path.append(str(p.parent)) #append to module path
from raspimon_images import Raspimons
from sense_hat import SenseHat
from time import sleep
sense = SenseHat()
raspis = Raspimons() #create the instance so we can use the Raspimons as a raspis variable.
#now we can simply call on the raspis instance to get the one we want!
sense.set_pixels(raspis.get_open_mouth())
sleep(0.4)
sense.set_pixels(raspis.get_closed_mouth())
sleep(0.3)
sense.set_pixels(raspis.get_open_mouth())
sleep(0.4)
sense.set_pixels(raspis.get_closed_mouth())
sleep(0.3)
sense.set_pixels(raspis.get_open_mouth())
sleep(0.4)
sense.set_pixels(raspis.get_closed_mouth())
sleep(0.3)
sense.set_pixels(raspis.get_open_mouth())
sleep(0.4)
sense.set_pixels(raspis.get_closed_mouth())
sleep(0.3)