Howdy, Stranger!

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

Supported by

Delay script while running eye tracker?

Hi Folks,

I'm writing an experiment in which participants are rewarded if their gaze is within an specified area end the end of random-length intervals between 4 and 7 seconds.

    delay = 3*random.random() + 4
    sample = eyetracker.sample()
    inRangeBool = inRange(sample[0],sample[1]) #returns True if the gaze is in the area of interest
    if inRangeBool:  #plays a pleasant sound associated with the reward

I'm using the dummy mouse eyetracker. When the script gets to the time.sleep command, the mouse freezes and doesn't move until the sleep function ends, which suggests that the function puts the eyetracker to sleep as well. The sound still plays (or doesn't) at the end of the interval. How can I tell the script to wait for the specified amount of time without freezing the eyetracker?


  • Hi,

    The eye tracker won't freeze if you sleep the experiment. That being said, you haven't specified what kind of eye tracker you're using. (But whatever it is: it won't freeze!)

    Incidentally, your script is an infinite loop, without any way to break it. I would at the very least flush the keyboard, so that you can exit it by pressing escape.


Sign In or Register to comment.