So now I have:
Code:
class RobotDemo : public SimpleRobot
{
Jaguar frontLeftMotor(1);
RobotDrive drivetrain(SpeedController *frontLeftMotor, SpeedController *rearLeftMotor, SpeedController *frontRightMotor, SpeedController *rearRightMotor, float sensitivity=0.5)
Joystick stick; // only joystick
public:
RobotDemo(void):
myRobot(1, 2), // these must be initialized in the same order
stick(1) // as they are declared above.
{
GetWatchdog().SetExpiration(0.1);
}
/**
* Drive left & right motors for 2 seconds then stop
*/
void Autonomous(void)
{
GetWatchdog().SetEnabled(false);
drivetrain.Drive(0.5, 0.0); // drive forwards half speed
Wait(2.0); // for 2 seconds
drivetrain.Drive(0.0, 0.0); // stop robot
}
/**
* Runs the motors with arcade steering.
*/
void OperatorControl(void)
{
GetWatchdog().SetEnabled(true);
while (IsOperatorControl())
{
GetWatchdog().Feed();
robotDrive.TankDrive(stick1,stick2);
Wait(0.005); // wait for a motor update time
}
}
};
START_ROBOT_CLASS(RobotDemo);
I need help declaring the Jaguars now
