Sorry, I meant to ask about the servo motors not the victor motors. If one were trying to initialize and use the servo motors would it be initialized like this (initializing two servos):
Code:
class RobotDemo : public SimpleRobot
{
RobotDrive myRobot; // robot drive system
Joystick stickRight, stickLeft; // only joystick
Servo (servoa); //Initialize servo 1 (or a)
Servo (servob); //Initialize servo 2 (or b)
and if this is correct, then how would one go about programming these to buttons? Could this code work?
Code:
//Example code
if ((stickRight->GetRawButton(4) == 1))
{
servoa->Set(.7f);
}
else if (stickRight->GetRawButton(4) == 0)
{
servoa->Set(0.0f);
}
Thank you for your help.
__________________
If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on.
-Steve Jobs
R.I.P. Steve Jobs 1955 - 2011. The Greatest Innovator of all time.