WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 11-21-2016, 11:22 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
It sounds like you need to determine whether the sensor was exited before two seconds elapsed. If that's the case, use the viztask.waitAny command to help with this:

Code:
def proximityTask():
	
	waitEnter = vizproximity.waitEnter(SensorIndexFinger)
	waitExit = vizproximity.waitExit(SensorIndexFinger)
	waitTime = viztask.waitTime(2)
	
	while True:
		yield waitEnter
		print 'entered sensor'
				
		d = yield viztask.waitAny( [ waitExit, waitTime ] )
		
		if d.condition is waitExit:
			print 'Sensor exited before two seconds'
		else: 
			print '2 seconds elapsed'
		
viztask.schedule(proximityTask())
Reply With Quote
 

Tags
proximity, proximity sensor, timing

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Proximity Manager - How to implement delay jelly Vizard 4 11-18-2016 08:48 AM
timer question Elittdogg Vizard 5 10-10-2007 02:49 PM


All times are GMT -7. The time now is 10:38 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC