PDA

View Full Version : vizact.ontimer problems?


vizLearner
11-19-2008, 01:48 PM
Hi all,
I have a program that is supposed to give stimuli to a subject and constantly monitor a button for feedback from the subject. The button is not keyboard, but connected by adding a .dls file. The method to check the button, however, never runs. I had an older version that used a callback to a timer_event perfectly, and I don't know why it won't work now. Heres the code below that I think is relevant...


def giveStimuli():
...
def checkButton():
...
vizact.ontimer(.001,checkButton)
starttimer(0,.001,FOREVER)
viztask.schedule(giveStimuli())

Jeff
11-19-2008, 02:42 PM
checkButton should be getting called. try

def checkButton():
print "in checkButton"

vizact.ontimer(0,checkButton)

this following line has incorrect syntax and you don't need it here for calling checkButton since you are using vizact.ontimer

starttimer(0,.001,FOREVER)

if you were using a callback with it it would be

viz.starttimer(0,0,viz.FOREVER)

one other thing is that your timer will not run every .001 seconds. It will only get called as fast as your framerate. If you use 0 for the rate the timer will be called every frame.