hi, i'm a beginner building an experiment with PTB3. I tried to record
reaction time and response key during a trial of 4 sec (fixed limit)
but all i managed to do is to switch to the next trial when a key is
pressed. I can have my RT and RK but only if my trial stop when a
response came. As a trial have to last 4 sec, i'm a bit lost. If
someone have an idea, i would appreciate. Thanks.
Here's my code:
Screen('DrawTexture',whichscreen,wa2);
Screen(whichscreen,'flip');
FinP=GetSecs+(1/f)*round(4*f);
while GetSecs<FinP
while (~keycode(Toucherep1))& (~keycode(Toucherep2))
[keyisdown,secs,keycode]= KbCheck;
answer=KbName(keycode)
if GetSecs<FinP, break, end
end
end
reaction time and response key during a trial of 4 sec (fixed limit)
but all i managed to do is to switch to the next trial when a key is
pressed. I can have my RT and RK but only if my trial stop when a
response came. As a trial have to last 4 sec, i'm a bit lost. If
someone have an idea, i would appreciate. Thanks.
Here's my code:
Screen('DrawTexture',whichscreen,wa2);
Screen(whichscreen,'flip');
FinP=GetSecs+(1/f)*round(4*f);
while GetSecs<FinP
while (~keycode(Toucherep1))& (~keycode(Toucherep2))
[keyisdown,secs,keycode]= KbCheck;
answer=KbName(keycode)
if GetSecs<FinP, break, end
end
end