Dear Psychopy users,
What I want to achieve: I am trying to send triggers (Oddball paradigm) via USB to LTP using Python or Psychopy and display them on BrainVision Recorder.
What works: the Windows Manager recognize in COM4 a Virtual Serial Port
What doesn’t work: when I run the python code to get access to the port:
Connected = True
PulseWidth = 0.01
if port.InWaiting ()> o:
#Open the Windows device manager search for the TriggerBox VirtualSerialPort
#in Ports/COM & LPT) and enter the port number in the constructor
port = serial.Serial(“COM4”)
#Start the read thread
thread = threading.Thread(targe=ReadThread, args=(port,))
#Set the port to an initial state
#Set Bit 0 Pin 1 of the Output (to Amp) connector
#Reset Bit0, Pin 2 of the Output (to Amp) connector port.write([0x00]) time.sleep(PulseWidth)
I get this error
"could not open port ‘COM4’: PermissionError(13, ‘a device connected to the system is not in function.’, None, 31)
Basically, python does not recognize the COM4 port.
Thank you in advance to everyone will provide constructive feedback,
To me looks kind of weird as python just access to the systems ports.