If this template helps then use it. If not then just delete and start from scratch.
OS (e.g. Win10): Win10 PsychoPy version (e.g. 1.84.x): 2020.1.3 Standard Standalone? (y/n) If not then what?: What are you trying to achieve?:
I’m trying to add EEG triggers/markers (via cpod) whenever I have a keyboard press (either button ‘1’ or ‘2’)
What did you try to make it work?:
I’ve tested the eeg trigger code separately and it works, but when i try to insert a code component to specify for the EEG trigger whenever a keyboard button is pressed, it doesn’t work. keyResponse is the name of my keyboard press. Code component as follow:
if keyResponse.keys == ‘1’:
for bm in range(1):
mask = 2 ** bm
print("activate_line bitmask: ", mask)
dev.activate_line(bitmask=mask)
elif keyResponse.keys == ‘2’:
for bm in range(1):
mask = 2 ** bm
print("activate_line bitmask: ", mask)
dev.activate_line(bitmask=mask)
What specifically went wrong when you tried that?:
The paradigm runs but i dont get the EEG trigger on my EEG recording software. I am however able to get a trigger if i just run the following:
for bm in range(1):
mask = 2 ** bm
print("activate_line bitmask: ", mask)
dev.activate_line(bitmask=mask)
I didnt use the inbuild parallel port as we are using a cpod, not sure if it is compatible with the parallel/serial port components?
The keyboard response isn’t ending the routine, it is a loop that repeats where different stimuli will be shown one after another and keyboard response is required for each stimuli.