Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Collecting data till button is pressed

I created an eye-tracking experiment: the person is presented a picture and then he either presses 1st or 2nd button. While he is looking i want to collect the gaze data.

The problem is - it only goes through loop once and collects only 1 value of the Gaza_data even if i wait for long time before pressing the button. What could be the problem?

Comments

  • Hi,

    Without knowing where buttonFake or buttonReal come from, it is impossible to say what happens here.

    I suppose you define the variables before the while loop, which is probably also the reason that it doesn't work. If the response is already given, then the while loop will not loop but be exited on the first iteration (buttonFake or buttonReal will already exist). I suppose you want to include the response collection into the loop, such that these variables will be None for as long as no response was given. To be clear, that is just my assumption based on that snippet, whether this is really the case, I can't tell without more info.

    Does that make sense?

    Eduard

    Buy Me A Coffee

  • @eduard Hi!

    Thank you for your response. The problem was solved by defining an extra value "button_not_pressed=True" before the loop , and assigning it to False when button!=None


Sign In or Register to comment.