forked from alexmburns/scroll-phat-hd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
progress.py
37 lines (29 loc) · 777 Bytes
/
progress.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
#!/usr/bin/env python
#Original code by alexellis, updated to run on scroll-phat-hd by alexmburns.
import math
import sys
import time
import scrollphathd
def millis():
return int(round(time.time() * 1000))
scrollphathd.set_brightness(0.5)
def clear(pause):
for y in range(7):
for x in range(17):
scrollphathd.set_pixel(x,y,0)
scrollphathd.show()
time.sleep(pause)
def paint(pause):
for y in range(7):
for x in range(17):
scrollphathd.set_pixel(x,y,1)
scrollphathd.show()
time.sleep(pause)
while(True):
try:
pause_time = 0.06
paint(pause_time)
clear(pause_time)
except KeyboardInterrupt:
scrollphathd.clear()
sys.exit(-1)