![]() |
Timer class
Hi, I have a problem, I use wait to time the motors on our robot, but then we ran into a problem where we would lose control of the robot untill it has finished the wait sequence. I have tried putting "myRobot->Drive(leftstick, rightstick)" in the function but we still would lose control. So I heard that I can use the Timer.h class to substitute for wait, I have tried this code on our bench top set up on a different cRio but it would jus run the motor non stop, when I disable it then enable, the motor starts running again. Can someone help me please?
Code:
class RobotDemo : public SimpleRobot |
Re: Timer class
I've made this mistake myself a few times. What's happening is that it's only checking to see if it should stop if and only if button 11 is pressed, which isn't what you want. Another problem you're running into is that the timer isn't resetting after it completes it's cycle, meaning it will only stop once and that's it. Below is the new tele-op code:
Code:
void OperatorControl(void)I hope this helps! |
| All times are GMT -5. The time now is 17:51. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi