Hi,
I am using the following code for sending the triggers to my EEG computer in my experiment (the code is suggested by PsychoPy)
if stimulus.status == STARTED and not stimulus_pulse_started: #Change ‘stimulus’ to match the name of the component that you want to send the trigger for
win.callOnFlip(port.write, str.encode(‘1’))
stimulus_pulse_start_time = globalClock.getTime()
stimulus_pulse_started = True
if stimulus_pulse_started and not stimulus_pulse_ended:
if globalClock.getTime() - stimulus_pulse_start_time >= 0.005:
win.callOnFlip(port.write, str.encode(‘0’))
stimulus_pulse_ended = True
This sends a ‘1’ as a trigger marker with my stimuli. However, it is said in the information that you can change the ‘1’ to whatever value is in your conditions file (xlxs). I have a condition called ‘trigger’ in my conditions file which I am using to pull stimuli from. How can I change the ‘1’ to the value I defined as ‘trigger’ in my conditions file in this code? The PsychoPy website says you can do it, but does not clarify how. My suspicion is that I should change this part:
win.callOnFlip(port.write, str.encode(‘1’))
Can anyone help please? Thank you all in advance.