-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathresetmatrix.py
136 lines (119 loc) · 2.08 KB
/
resetmatrix.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/usr/bin/python3
from __future__ import print_function
from gpiozero import LED
from time import sleep
# 0123456789012345
b12a="0111111111111111"
b12b="0111100000111111"
b12c="0111111111111111"
b12d="0111100000111111"
b12a="0111111111111111"
b12b="0111111111111111"
b12c="0111111111111111"
b12d="0111111111111111"
b13a="0000000001000000"
b13b="0000000001000000"
b13c="0000000001000000"
b13d="0000000001000000"
# b12 - 1 adds red tinge
# b12 - 9/8/7/6/5 = 4 bit brightness
# b13 - 9 =1 screen on
# b13 - 6 =1 screen off
xr1=LED(5)
xr2=LED(12)
xg1=LED(13)
xg2=LED(16)
xb1=LED(6)
xb2=LED(23)
xA=LED(22)
xB=LED(26)
xC=LED(27)
xD=LED(20)
xLAT=LED(21)
xCLK=LED(17)
xOE=LED(4)
xCLK.off()
xOE.off()
xA.on()
xB.off()
xC.off()
xD.off()
xr1.off()
xr2.off()
xg1.off()
xg2.off()
xb1.off()
xb2.off()
b12=b12a
b13=b13a
for x in range(128):
y=x%16
if(y==0):
print(' ',end='')
if (b12[y:y+1] is "0"):
print('0',end='')
xr1.off()
xr2.off()
xg1.off()
xg2.off()
xb1.off()
xb2.off()
else:
print('1',end='')
xr1.on()
xr2.on()
xg1.on()
xg2.on()
xb1.on()
xb2.on()
xCLK.on()
sleep(0.001)
xCLK.off()
sleep(0.001)
if(x>31):
b12=b12b
if(x>63):
b12=b12c
if(x>95):
b12=b12d
if(x==(128-12)):
print('*',end='')
xLAT.on()
xLAT.off();
print('')
for x in range(128):
y=x%16
if(y==0):
print(' ',end='')
if (b13[y:y+1] is "0"):
print('0',end='')
xr1.off()
xr2.off()
xg1.off()
xg2.off()
xb1.off()
xb2.off()
else:
print('1',end='')
xr1.on()
xr2.on()
xg1.on()
xg2.on()
xb1.on()
xb2.on()
xCLK.on()
sleep(0.001)
xCLK.off()
sleep(0.001)
if(x>31):
b13=b13b
if(x>63):
b13=b13c
if(x>95):
b13=b13d
if(x==(128-13)):
print('*',end='')
xLAT.on()
xLAT.off();
print('')
xOE.on();