forked from sthronevlt/Stradus
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.py
More file actions
31 lines (29 loc) · 875 Bytes
/
example.py
File metadata and controls
31 lines (29 loc) · 875 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
import vortran_lbl as vortran
if __name__ == "__main__":
my_connection = []
devices = vortran.get_usb_ports()
lasers = list()
if devices:
for device in devices:
if devices[device]["is_manager"]:
manager = device
else:
lasers.append(device)
print("Attaching Endpoint", device)
my_timeout = 500
my_retries = 0
for laser in lasers:
new_connection = vortran.USB_ReadWrite(
devices[laser],
my_timeout,
my_retries,
is_protocol_laser=True,
)
my_connection.append(new_connection)
is_open = my_connection[-1].open_connection()
print("IS CONNECTION OPEN: {is_open}")
r = my_connection[-1].send_usb(
cmd="LE=1",
writeOnly=False,
)
print(r)