add multiple diff buttons to save values into diff indexes of potentiometer array...
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / intakearm / RecordPotAngle.java
index bb9a01208457c11e654a2d87040573f06af86b57..589bcb7358f1ad601b7304f633bc2c2601e52def 100644 (file)
@@ -9,14 +9,17 @@ import edu.wpi.first.wpilibj.command.Command;
  */
 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
@@ -27,7 +30,7 @@ public class RecordPotAngle extends Command {
   // 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