public class Robot {
private Spark motorFrontLeft = new Spark (0);
private Spark motorRearLeft = new Spark (2);
private Spark motorFrontRight = new Spark (1);
private Spark motorRearRight = new Spark (3);
** private Spark motorTilt = new Spark (4);**
private SpeedControllerGroup motorLeft = new SpeedControllerGroup (motorFrontLeft, motorRearLeft);
private SpeedControllerGroup motorRight = new SpeedControllerGroup (motorFrontRight, motorRearRight);
private DifferentialDrive driveTrain = new DifferentialDrive (motorLeft, motorRight);
private static final Joystick joystick = new Joystick (0);
public Robot () {
driveTrain.setExpiration (0.1);
}
public void robotInit () {}
public void teleopPeriodic () {
driveTrain.arcadeDrive (0.5 * joystick.getY(), 0.5 * joystick.getX());
**if (joystick.getTrigger()==true) {
motorTilt.set (-0.3);
} else if (joystick.getTop()==true){
motorTilt.set(0.3);
}else {
motorTilt.set(0);
} **
}
public void test () {}
}
Is the code theoretically alright?