16
16
'double-gradient' , 'zigzag' , 'panic' , 'lotus2' ]
17
17
DRAW_PATTERNS = ['off' , 'on' , 'foo' ]
18
18
19
+ SERIAL_DEV = None
20
+
19
21
20
22
def main ():
21
23
parser = argparse .ArgumentParser ()
@@ -41,8 +43,14 @@ def main():
41
43
action = "store_true" )
42
44
parser .add_argument ("--panic" , help = "Crash the firmware (TESTING ONLY)" ,
43
45
action = "store_true" )
46
+ parser .add_argument ("--serial-dev" , help = "Change the serial dev. Probably /dev/ttyACM0 on Linux, COM0 on Windows" ,
47
+ default = '/dev/ttyACM0' )
44
48
args = parser .parse_args ()
45
49
50
+ if args .serial_dev is not None :
51
+ global SERIAL_DEV
52
+ SERIAL_DEV = args .serial_dev
53
+
46
54
if args .bootloader :
47
55
bootloader ()
48
56
elif args .sleep is not None :
@@ -180,7 +188,8 @@ def clock():
180
188
181
189
def send_command (command ):
182
190
print (f"Sending command: { command } " )
183
- with serial .Serial ('/dev/ttyACM0' , 9600 ) as s :
191
+ global SERIAL_DEV
192
+ with serial .Serial (SERIAL_DEV , 9600 ) as s :
184
193
s .write (command )
185
194
186
195
@@ -249,6 +258,8 @@ def gui():
249
258
window .close ()
250
259
251
260
261
+ # 5x6 font. Leaves 2 pixels on each side empty
262
+ # We can leave one row empty below and then the display fits 5 of these digits.
252
263
def number (num ):
253
264
numbers = {
254
265
'0' : [
0 commit comments