|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Turning a motor for a specified time (timer)
Hello,
we want to turn one of out motors for a specified amount of time everytime a button on the joystick is pressed. Which structure should we use? Can we use it directly on Teleop.vi? |
|
#2
|
|||||
|
|||||
|
Re: Turning a motor for a specified time (timer)
It's easiest to do it in Periodic Tasks like this:
![]() You must use different code in Teleop, because loops should not be used there. Essentially, you would take the current time, add your delay to it whenever the button is pressed, then separately check to see if the time less than your target and set the motor speed accordingly. Last edited by Mark McLeod : 15-02-2014 at 09:17. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|