OS: Win10
PsychoPy version: 3.1.5
What are you trying to achieve?:
I’d like to send a trigger when a monitor flips to show a stimulus. I’d also like to log the time of trigger in the excel data file to be able to double check its being sent at the same time of the flip.
What did you try to make it work?:
before routine:
trigger_start = []
win.callOnFlip(port.write, b'1')
win.timeOnFlip(trigger_start)
end routine:
thisExp.addData('trigger_start', trigger_start.triggerStart)
What specifically went wrong when you tried that?:
The function port.write(b’1’) works to send a trigger, but there is lag and I realized it would be ideal for the trigger to be sent when the screen flips. I’m just confused how I would use callOnFlip and timeOnFlip sync the trigger with the screen flip and log the time in the excel file. Will the callOnFlip code I’ve written wait for when my stimulus is shown on the screen?
What I tried gave this error message:
win.timeOnFlip(trigger_start)
TypeError: timeOnFlip() missing 1 required positional argument: 'attrib'
I’ve tried to give trigger_start and attribute.