+package org.usfirst.frc3501.RiceCatRobot.commands;
+
+import org.usfirst.frc3501.RiceCatRobot.subsystems.Arm;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class MoveArmTillSwitchHit extends Command {
+ Arm arm; //declares the arm object to reference some methods
+ double slowSpeed = 0.2; //Slow speed to reach a limit switch
+
+ public MoveArmTillSwitchHit(double leveldesired) {
+ arm.setArmSpeeds(slowSpeed); //Moves the arm to a certain slow speed
+ }
+
+ protected void initialize() {
+ arm.initializeCounter();
+ }
+
+ protected void execute() {
+ }
+
+ protected boolean isFinished() {
+ return arm.isSwitchHit();
+ }
+
+ protected void end() {
+ arm.stop(); //stops arm once limit switch hit
+ }
+
+ protected void interrupted() {
+ end();
+ }
+}