Limited stimulus presentation time and response registration

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]
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
OP: how do you define participants' response? keyboard hit?
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?
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
Ow yes, you're right, I was confusing different things. I get it now. Thank you!
Topic archived. No new replies allowed.