-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemulatorRunner.py
More file actions
35 lines (27 loc) · 919 Bytes
/
emulatorRunner.py
File metadata and controls
35 lines (27 loc) · 919 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
import sys
import os
import serial.tools.list_ports as port_list
# Set PYLSL_LIB environment variable BEFORE importing any modules that use pylsl
if sys.platform == "win32":
# Now import modules that depend on pylsl
from EmulatorCOM import EmulatorCOM
from AxonCOM import State
os.environ["PYLSL_LIB"] = r".\\liblsl-1.16.2-Win_amd64\\lib\\lsl.lib"
elif sys.platform == "darwin":
os.environ["PYLSL_LIB"] = r"./liblsl-1.16.2-OSX_amd64/lib/liblsl.dylib"
# Now import modules that depend on pylsl
from EmulatorCOM import EmulatorCOM
from AxonCOM import State
else:
print("Unsupported platform")
exit()
streamingStarted = False
emmy = EmulatorCOM()
print("connecting...")
emmy.connect("commock")
emmy.init()
while(True):
if(not emmy.state==State.streaming):
print("streaming")
emmy.stream()
streamingStarted = True