We are a rookie team and we wrote the following code to operate the motor.
We are not sure if it will work. Please help.
public class ParkwayRobot extends SimpleRobot
{
private final int PORT_ONE = 1;
private final int PORT_TWO = 2;
private final int MY_SLOT = 1; // or 2, 3, 4
private final double DESIRED_SPEED = 0.7;
RobotDrive drive = new RobotDrive(1, 2); // motors in ports 1 and 2
Joystick leftJoy = new Joystick(PORT_ONE);
Joystick rightJoy = new Joystick(PORT_TWO);
public void autonomous()
{
Jaguar firstJaguar = new Jaguar(MY_SLOT, PORT_ONE);
firstJaguar.set(DESIRED_SPEED); // between -1.0 and 1.0
}
public void operatorControl()
{
while (isOperatorControl() && isEnabled())
{
Drive.tankDrive(leftJoy, rightJoy);
Timer.delay(0.005);
}
}
}
We are not sure how to compile and run this code using Netbeans. Please help.
Thanks a lot!