-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshow_time.py
62 lines (54 loc) · 1.62 KB
/
show_time.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python
import max7219.led as led
import datetime
import time
from max7219.font import proportional, SINCLAIR_FONT, TINY_FONT, CP437_FONT
from random import randrange
device = led.matrix(cascaded=4)
device.orientation(90)
device.brightness(1)
while(True):
clock = time.strftime("%H%M")
for n, c in enumerate(clock):
device.letter(n, ord(c))
time.sleep(5)
#for _ in range(2):
#for increaseintensity in xrange(5):
# device.brightness(increaseintensity)
# time.sleep(0.1)
#for decreaseintensity in xrange(1):
# device.brightness(decreaseintensity)
# time.sleep(0.1)
#time.sleep(60)
#for row in range(8): # 8 = number of rows to scroll down
#device.scroll_down()
#time.sleep(.05) # controls scroll down speed
#device.show_message(time.strftime("%b. %d"))
#time.sleep(1)
##############################TESTING BELOW##################################
#for n, i in list(enumerate(clock))[::-1]:
#print i
# while(True):
# clock = datetime.datetime.now().strftime("%I%M")
# for n, c in enumerate(clock):
# device.letter(n, ord(c))
# time.sleep(1)
# for intensity in xrange(5):
# device.brightness(intensity)
# time.sleep(0.1)
# for row in range(8):
# device.scroll_down(8)
# time.sleep(.5)
# device.show_message(time.strftime("%b %d %Y"))
# while(True):
# clock = datetime.datetime.now().strftime("%I%M")
# for n, c in enumerate(clock):
# device.letter(n, ord(c))
# time.sleep(1)
# for intensity in xrange(5):
# device.brightness(intensity)
# time.sleep(0.1)
# for row in range(8):
# device.scroll_down(8)
# time.sleep(.5)
# device.show_message(time.strftime("%b %d %Y"))