create new command to record pot angle when button pressed
authorCindy Zhang <cindyzyx9@gmail.com>
Tue, 16 Feb 2016 23:30:20 +0000 (15:30 -0800)
committerHarel Dor <hareldor@gmail.com>
Tue, 23 Feb 2016 06:41:40 +0000 (22:41 -0800)
src/org/usfirst/frc/team3501/robot/commands/intakearm/RecordPotAngle.java [new file with mode: 0644]

diff --git a/src/org/usfirst/frc/team3501/robot/commands/intakearm/RecordPotAngle.java b/src/org/usfirst/frc/team3501/robot/commands/intakearm/RecordPotAngle.java
new file mode 100644 (file)
index 0000000..bb9a012
--- /dev/null
@@ -0,0 +1,43 @@
+package org.usfirst.frc.team3501.robot.commands.intakearm;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/**
+ *
+ */
+public class RecordPotAngle extends Command {
+
+  public RecordPotAngle() {
+    requires(Robot.intakeArm);
+  }
+
+  // Called just before this Command runs the first time
+  @Override
+  protected void initialize() {
+    Robot.intakeArm.potAngles[0] = Robot.intakeArm.getArmAngle();
+  }
+
+  // Called repeatedly when this Command is scheduled to run
+  @Override
+  protected void execute() {
+  }
+
+  // Make this return true when this Command no longer needs to run execute()
+  @Override
+  protected boolean isFinished() {
+    return false;
+  }
+
+  // Called once after isFinished returns true
+  @Override
+  protected void end() {
+  }
+
+  // Called when another command which requires one or more of the same
+  // subsystems is scheduled to run
+  @Override
+  protected void interrupted() {
+  }
+}