#1
|
|||
|
|||
Timer event in viztask
I am trying to detect when a timer has expired in order to capture the time it takes a person to respond to a change. Using viztask, my code looks something like
Code:
# Start a timer viz.starttimer(0, 1, viz.PERPETUAL) # define our changing function def changeThing(): # change the thing thing = thing + change # Register the timer callback viz.callback(viz.TIMER_EVENT, changeThing) # Define the experimental loop def experiment(): # Initialize trial number trial = 1 # Wait for spacebar to begin experiment yield viztask.waitKeyDown(' ') while trial <= numTrials: # Update the instructions msgbox.message('Trial ' + str(trial)) # Wait for the timer yield viztask.waitEvent( viz.TIMER_EVENT ) # Wait for response yield viztask.waitKeyDown(' ') # Increment the trial number trial = trial + 1 # Schedule the experiment viztask.schedule( experiment() ) Thanks!
__________________
Virtual Environments and Multimodal Interaction (VEMI) Lab This time, it should work... |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
timer question again | Elittdogg | Vizard | 3 | 10-18-2007 10:29 AM |
Timer speed | Jerry | Vizard | 1 | 12-08-2006 11:01 AM |
sending event markers to a monitoring computer | mikestatic | Vizard | 3 | 01-26-2006 09:23 AM |
Elapse timer | astull | Vizard | 1 | 12-14-2005 11:34 AM |
Timer event documentation | pkhoosh | Vizard | 1 | 10-21-2005 10:12 AM |