=== delete this after reading ===
Please make sure you read this post before asking for help. No one can help you unless you provide a clear description of the software environment you are using and your programming problem…
=== delete until here ===
Dear PTB community,
I’m building an experiment in PTB in which subjects need to press a specific button within a 2 second period in response to a stimulus. If they press the wrong button they would receive a “WRONG ANSWER!” feedback. If they are too slow they get a “FASTER!” feedback. I would also like to record subjects’ reaction times to each new stimulus. I tried to see if I could use KbWait to do all of that. So far I managed to get the “WRONG ANSWER FEEDBACK!” this way:
“” [secs,keys]=KbWait();
if find(keys) ~= 75
DrawFormattedText(w,‘WRONG!’,‘center’,‘center’,[1 0 0]);
Screen(‘Flip’,w);
WaitSecs(0.3); “”
So so far so good… now for the reaction time it’s another story. I initially tried to do it this way based on what I could gather from other discussions elsewhere:
“” MaxT = 2;
[secs,keys]=KbWait();
if find(secs)>MaxT
DrawFormattedText(w,‘FASTER!’,‘center’,‘center’,[1 0 0]);
Screen(‘Flip’,w);
WaitSecs(0.3); “”
There’s no error message in the script when I run it but I also do not get the “FASTER!” feedback after two seconds. Also, when checking on find(secs) to get the response times I always get the same answer = 1. So I suspect there’s something I missed about the KbWait function… could any of you enlighten me on this?
Thank you in advance!
Nic