a3b77acfd3a2dd127e03bddd608ee6f2f3f0032f
[3501/2015-FRC-Spark] / src / org / usfirst / frc3501 / RiceCatRobot / commands / MoveArmToLevel.java
1 package org.usfirst.frc3501.RiceCatRobot.commands;
2
3 import org.usfirst.frc3501.RiceCatRobot.subsystems.Arm;
4
5 import edu.wpi.first.wpilibj.command.Command;
6
7 public class MoveArmToLevel extends Command {
8 Arm arm;
9 double slowSpeed = 0.2; //Slow speed to reach a limit switch
10
11 public MoveArmToLevel(double leveldesired) {
12 arm.setArmSpeeds(slowSpeed); //Moves the arm to a certain slow speed
13 }
14
15 protected void initialize() {
16 arm.initializeCounter();
17 }
18
19 protected void execute() {
20 }
21
22 protected boolean isFinished() {
23 return arm.isSwitchHit();
24 }
25
26 protected void end() {
27 arm.stop(); //stops arm once limit switch hit
28 }
29
30 protected void interrupted() {
31 end();
32 }
33 }