Uses arrays and sends message when a specific limitswitch is hit
[3501/2015-FRC-Spark] / src / org / usfirst / frc3501 / RiceCatRobot / commands / MoveArmToLevel1.java
diff --git a/src/org/usfirst/frc3501/RiceCatRobot/commands/MoveArmToLevel1.java b/src/org/usfirst/frc3501/RiceCatRobot/commands/MoveArmToLevel1.java
new file mode 100644 (file)
index 0000000..158a4be
--- /dev/null
@@ -0,0 +1,33 @@
+package org.usfirst.frc3501.RiceCatRobot.commands;
+
+import org.usfirst.frc3501.RiceCatRobot.subsystems.Arm;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class MoveArmToLevel1 extends Command {
+       Arm arm;
+       double slowSpeed = 0.2;
+
+       public MoveArmToLevel1() {
+               arm.setArmSpeeds(slowSpeed);
+       }
+
+       protected void initialize() {
+               arm.initializeCounters();
+       }
+
+       protected void execute() {
+       }
+
+       protected boolean isFinished() {
+               return arm.isSwitch1Hit();
+       }
+
+       protected void end() {
+               System.out.println("Robot arm has reached level 1");
+       }
+
+       protected void interrupted() {
+               end();
+       }
+}