|
Re: Help needed with coding simultaneous movement (EasyC/VEX)
When you mean "actively controlled" do you mean you are driving it, or wether or not the remote is on.
For back and forth you could set an integer to 1 or 0. If the integer equaled 1, it would count up to 255, and when the servo hit 255, the integer would be switched to 0 and cause it to count down back to a servo value of 0, where the integer would be set back to 1 and count up again... repeating...(use ++ and --)
If you wanted this to go just when the robot is being driven (as in currently moving), use an if statement to check the joystick values (if they aren't centered, you know its being driven)
|