Triggers via PsychoPy Mislabeling in ActiView
Posted: Thu Sep 29, 2022 4:28 pm
I am trying to get my experiment in PsychoPy to work with ActiView using coding in Python. I've been able to effectively send triggers to the system, but I get a few random numbers that replace actual condition labels. There doesn't appear to be any pattern to them (they don't appear at specific time points or for specific trigger values/conditions).
These incorrect numbers are 242 and 192. They are replacing any one of the trigger codes I specified for each condition (1, 2, or 3).
Anyone have any experience with this or ideas on how to keep these errors from occurring in the first place? Are there certain values that would be better for the BIOSEMI system when coding triggers?
I'm hoping I don't have to change them manually during preprocessing of the EEG data for every participant. I can share my experiment file if that helps. Below is my code in PsychoPy for triggers
"Begin experiment"
import serial
port = serial.Serial("COM4", baudrate = 115200)
"Begin routine"
port.write(trigger)
if trigger == 1:
port.write(1)
elif trigger == 2:
port.write(2)
elif trigger == 3:
port.write(3)
port.write(str.encode(chr(trigger)))
port.flush()
"End experiment"
port.close()
Thanks!
These incorrect numbers are 242 and 192. They are replacing any one of the trigger codes I specified for each condition (1, 2, or 3).
Anyone have any experience with this or ideas on how to keep these errors from occurring in the first place? Are there certain values that would be better for the BIOSEMI system when coding triggers?
I'm hoping I don't have to change them manually during preprocessing of the EEG data for every participant. I can share my experiment file if that helps. Below is my code in PsychoPy for triggers
"Begin experiment"
import serial
port = serial.Serial("COM4", baudrate = 115200)
"Begin routine"
port.write(trigger)
if trigger == 1:
port.write(1)
elif trigger == 2:
port.write(2)
elif trigger == 3:
port.write(3)
port.write(str.encode(chr(trigger)))
port.flush()
"End experiment"
port.close()
Thanks!