View Single Post
  #3  
Old 04-06-2015, 10:34 AM
itruginski itruginski is offline
Member
 
Join Date: Mar 2015
Posts: 2
Quote:
Originally Posted by mape2k View Post
Hi,

you can do that by defining a function and calling that function repeatedly at a give rate with the vizard <ontimer> function. See my quick example below.

Code:
import viz
import vizact

def writeJoystickPosition():

	joyData1 = joy1.getPosition()
        joyData2 = joy2.getPositio()

        here some lines to write it to a file....

logJoystick = vizact.ontimer(0,writeJoystickPosition)	# start the function

viz.go()
If you start ontimer with a 0, it will call the function each frame. You can also put in other values, e.g. 1 would mean every second.
Thanks a ton! I really appreciate the thoughtful and clear response. I'm going to work on implementing this today.
Reply With Quote