Serial Port EEGbiosemi

Hi There,

Unfortunately the parallel port component doesn’t yet support communication with the serial port. You will need to use a code component something like this

import serial

#serial port settings - Begin Experiment tab in a code component
s_port = serial.Serial()         #serial port name
s_port.port = 'COM3'             # chosen serial port 
s_port.timeout = 1               # timeout 1 second (give 1 second to the board to initialize port)
s_port.open()                    #open serial port to start routine

# to mark the trigger - Each frame tab of code component (note you will probably need an if statement to make sure onset it the time you want)
win.callOnFlip(s_port.write, str.encode('1'))# where '1' is the start value

# to stop the trigger- Each frame tab of code component (note you will probably need an if statement to make sure offset it the time you want)
win.callOnFlip(s_port.write,  str.encode('0'))# where '0' is the stop value

- end experiment tab
s_port.close() #in the end the serial port must be closed

Let me know if this works,
Becca