-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscreen.py
More file actions
executable file
·42 lines (33 loc) · 803 Bytes
/
Copy pathscreen.py
File metadata and controls
executable file
·42 lines (33 loc) · 803 Bytes
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
#!/usr/bin/env python3
from time import sleep
import adlinkusb
import sys
from screen_config import up, down, clear
def printhelp():
print("screen.py controls the adlink relays at New Hope.\n" +
"\tusage:" +
"\tscreen.py [-u/-d/-h]\n" +
"\t-u) roll screen up\n" +
"\t-d) roll screen down\n" +
"\t-h) print this message")
if len(sys.argv) != 2:
print("Wrong number of arguments!\n")
printhelp()
exit(1)
match sys.argv[1]:
case "-d":
code = down
case "-u":
code = up
case "-h":
printhelp()
exit()
case _:
print("Unrecognized argument!\n")
printhelp()
exit()
device = adlinkusb.DAQ7250()
device.connect()
device.set_dos(code)
sleep(0.5)
device.set_dos(clear)