From 7ccd0b7a837b9bee50676d9c0264ec97aea459db Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Tue, 16 Feb 2016 16:01:11 -0800 Subject: [PATCH] add multiple diff buttons to save values into diff indexes of potentiometer array of angles --- .../robot/commands/intakearm/RecordPotAngle.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/org/usfirst/frc/team3501/robot/commands/intakearm/RecordPotAngle.java b/src/org/usfirst/frc/team3501/robot/commands/intakearm/RecordPotAngle.java index bb9a0120..589bcb73 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/intakearm/RecordPotAngle.java +++ b/src/org/usfirst/frc/team3501/robot/commands/intakearm/RecordPotAngle.java @@ -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 -- 2.30.2