I am running an MEG experiment using psychopy. It is a motor learning task so participants learn 4-element finger-press sequences. They have 2 sequences to learn and each sequence is associated with an image (sequence cue), so far I have added in a trigger for the sequence cue which works well.
Then on the next routine I have added a trigger for the go cue (a hand that tells the participant they can now perform the sequence) and then for each key press.
The order of triggers: sequence cue, go cue, key presses.
The first problem: The last key press made (4th one) is triggered on the go cue of the next trial so only 3 presses and the go cue appear in each trial.
The second problem: The trigger for the go cue also appears for each key press as well.
What I have tried to do to solve this: I tried to move the parallel port in the builder below the keypresses and turn the sync to screen off as suggested in this post (Screen refresh delay in sending parallel port response triggers) and I have changed the code for the keypresses from the begin routine tab into the each frame tab. This is the code I use to trigger each key press which works:
if key_respB.keys == ‘7’:
keyrespB_port.setData(16)
if key_respB.keys == ‘8’:
keyrespB_port.setData(32)
if key_respB.keys == ‘9’:
keyrespB_port.setData(64)
if key_respB.keys == ‘0’:
keyrespB_port.setData(128)
Key press 7 is triggered on channel 5, 8 on channel 6, 9 on channel 7 and 0 on channel 8.
Although, when I move it to the each frame tab I still have the problem of the last key press being in the next trial on the go cue and each trigger appears on the same channel for the key presses.
This is what the builder looks like at the moment:
Any help would be much appreciated!
Thank you,
Helena