add multiple diff buttons to save values into diff indexes of potentiometer array...
authorCindy Zhang <cindyzyx9@gmail.com>
Wed, 17 Feb 2016 00:01:11 +0000 (16:01 -0800)
committerHarel Dor <hareldor@gmail.com>
Tue, 23 Feb 2016 06:42:40 +0000 (22:42 -0800)
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