Write using phantom omni
Good evening to everyone,
i am trying to use the phantom omni to write a letter. I would like to have a function active while the buttom of the omni is down; for all this time the function has to print the trajectory of the omni. Any ideas? Thanks in advance |
This is the code:
Code:
import viz The effect should be the on of a digital sign! |
The 'write' function is probably called continuously as long as button1 is held down. If that's the case the final value of pos0 will be the same as pos1. You could add a flag so that the write function only saves to pos0 the first time it is called. Then reset the flag when the buttonup event occurs.
|
Hy jeff and thanks to give always an answer to my doubts.
The function write is called every time that button 1 is pressed,it doesn't matter if it held down or not. Anyway,I have found on this forum a similar post,in which you suggested to use the pencil from the tools module. This is the code and it works: Code:
import viz Suggestions? I need something like when you enter in this function,execute and repeat it until this event happens. The problem is that with the while loop everything freeze :( |
It sounds like you could set this up within a task function and wait for the sensor event to both start and stop the drawing:
Code:
def DrawingTask(): |
All times are GMT -7. The time now is 10:46 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC