public static Joystick leftJoystick;
public static Joystick rightJoystick;
- public static Button recordPotAngle;
+ public static Button recordPotAngle1;
+ public static Button recordPotAngle2;
+ public static Button recordPotAngle3;
+ public static Button recordPotAngle4;
// // first column of arcade buttons - getting past defenses
// public static DigitalButton passPortcullis;
leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
- recordPotAngle = new JoystickButton(leftJoystick,
- Constants.OI.LEFT_JOYSTICK_TOP_CENTER_PORT);
- recordPotAngle.whenPressed(new RecordPotAngle());
+ recordPotAngle1 = new JoystickButton(leftJoystick, 4);
+ recordPotAngle1.whenPressed(new RecordPotAngle(0));
+ recordPotAngle2 = new JoystickButton(leftJoystick, 3);
+ recordPotAngle2.whenPressed(new RecordPotAngle(1));
+ recordPotAngle3 = new JoystickButton(leftJoystick, 5);
+ recordPotAngle3.whenPressed(new RecordPotAngle(2));
+ recordPotAngle4 = new JoystickButton(leftJoystick, 2);
+ recordPotAngle4.whenPressed(new RecordPotAngle(3));
// passPortcullis = new DigitalButton(
// new DigitalInput(Constants.OI.PASS_PORTCULLIS_PORT));
*/
public class RecordPotAngle extends Command {
- public RecordPotAngle() {
+ private static int index;
+
+ public RecordPotAngle(int index) {
requires(Robot.intakeArm);
+ this.index = index;
}
// Called just before this Command runs the first time
@Override
protected void initialize() {
- Robot.intakeArm.potAngles[0] = Robot.intakeArm.getArmAngle();
+ Robot.intakeArm.potAngles[index] = Robot.intakeArm.getArmAngle();
}
// Called repeatedly when this Command is scheduled to run
// Make this return true when this Command no longer needs to run execute()
@Override
protected boolean isFinished() {
- return false;
+ return true;
}
// Called once after isFinished returns true