Hey Mike,
Apologies for not providing the necessary information! We are coding this task on a Dell 32 bit computer using psychopy version 1.82.01.
I am attempting to create a variation of the “Go/No-go” task with response feedback, in which participants are to respond (by pressing either the left or right trigger on a game controller) when they see certain stimuli (i.e., “2” and “3”) and withhold responses when another appears (i.e., “1”). A trial will contain a fixation cross “+” for 900 ms., then one of the three stimuli for 250 ms., and then a blank screen for 450 ms. After the blank screen, I would like the participant to receive a feedback message “correct” or “incorrect” for the response that they made. The presented stimuli will be random and is located in a conditions file. A basic break down of the stimuli + response = message loop is below.
-Stimuli “1” + no trigger response = “correct” message
-Stimuli “1” + trigger response = “incorrect” message
-Stimuli “2” or “3” + no trigger response = “incorrect” message
-Stimuli “2” or “3” + trigger response = “correct” message
I have been able to present feedback using only one of the triggers in the past; however, I am having difficulty with coding for the use of the option of left and right trigger response. Essentially our feedback seems to be coming in at random instead of lining up with our above expectations.
The coding the experiment is below:
-Within the stimuli presentation routine, the response code is:
Begin Experiment-
response_ttl = parallel.ParallelPort(address='0x0378')
Begin Routine-
response_event=None
trial_start=0
io.clearEvents()
Each Frame-
if frameN == 0:
io.clearEvents('all')
trial_start=core.getTime()
gp_triggers = gamepad.getTriggers()
trig_time = gp_triggers['time']
left_val, right_val = gp_triggers['left_trigger'], gp_triggers['right_trigger']
if frameN >= 12 and frameN <= 48:
if left_val > 0.2 or right_val > 0.2:
if left_val > 0.2:
response = 'left_trigger'
if right_val > 0.2:
response = 'right_trigger'
if response == 'left_trigger' or response == 'right_trigger':
response_ttl.setData(16)
if response_ttl.status == STARTED and frameN >= (response_ttl.frameNStart + 4):
response_ttl.setData(0)
else:
response = 'None'
End routine-
response_ttl.setData(0)
-Within the feedback presentation routine, the code is:
Begin Routine-
if response == 'None' and Stim == 1:
msg="Correct!"
elif response == 'left_trigger' or 'right_trigger' and Stim == 2 or 3:
msg="Correct!"
else:
msg="Oops! That was wrong."
End routine-
io.clearEvents('all')
The conditions file looks like:
Jitter Stim Stim_Signal corrAns msg
42 1 2 None Incorrect!
48 2 4 left_trigger Correct!
54 3 8 left_trigger Incorrect!
60 1 2 None Correct!
66 2 4 left_trigger Incorrect!
42 3 8 left_trigger Correct!
48 1 2 None Incorrect!
54 2 4 left_trigger Correct!
60 3 8 left_trigger Incorrect!
66 1 2 None Correct!
42 2 4 left_trigger Incorrect!
48 3 8 left_trigger Correct!
54 1 2 None Incorrect!
60 2 4 left_trigger Correct!
66 3 8 left_trigger Incorrect!
Let me know if any other information is needed. Your help is very much appreciated.
Best,
Danielle