Limited stimulus presentation time and response registration

Nov 7, 2017 at 2:45pm
Hi,

I'm working on an experimental psychology experiment. In the piece of code beneath what I want to do is present a stimulus for 600ms and of course register the participant's respons. So in the code I you can see that I present the stimulus for 600 ms, take it of and than start the respons registration. However, participants should be able to respond from the moment the stimulus comes on the screen and that doesn't work this way. Does anyone know how you can doe it then? Because if you put the response registration function before the wait function it certainly doesn't work.

[code]
ts5_flip_display();
ts5_wait(0.6);
ts5_clear_display();
ts5_flip_display();

ts5_flush_responses();
data[nr].r = ts5_wait_for_response_timed(&t2, &e1, RESPTIME);
[code]
Nov 7, 2017 at 3:10pm
Right now your look code looks like this:
1
2
wait(0.6);
wait_until_participant_responds();

What you need to do instead is
1
2
3
4
5
for (int i = 0; i < 60; i++){
    wait(0.01);
    if(participant_has_responded())
        break;
}
Last edited on Nov 7, 2017 at 4:57pm
Nov 7, 2017 at 3:29pm
OP: how do you define participants' response? keyboard hit?
Nov 7, 2017 at 4:42pm
Yes, they are supposed to respond with the Q, S, L, or M keyboard button. But about the procedure despcribed by helios, does it then not matter what the refresh rate of the screen is?
Nov 7, 2017 at 4:56pm
What do you mean? In your code you're already waiting for 0.6 seconds without flipping the display, so I assume you don't care if it gets refreshed or not.
Last edited on Nov 7, 2017 at 5:38pm
Nov 7, 2017 at 5:33pm
Ow yes, you're right, I was confusing different things. I get it now. Thank you!
Topic archived. No new replies allowed.