add command to robot.java to actually run the LimitSwitchTest
[3501/2015-FRC-Spark] / src / org / usfirst / frc3501 / RiceCatRobot / commands / MoveArmToLevel3.java
1 package org.usfirst.frc3501.RiceCatRobot.commands;
2
3 import org.usfirst.frc3501.RiceCatRobot.Robot;
4 import org.usfirst.frc3501.RiceCatRobot.subsystems.Arm;
5
6 import edu.wpi.first.wpilibj.command.Command;
7
8 public class MoveArmToLevel3 extends Command {
9
10 double slowSpeed = 0.2;
11
12 public MoveArmToLevel3() {
13 if (Robot.arm.getArmSpeed() == 0.0) {
14 Robot.arm.setArmSpeeds(slowSpeed);
15 }
16 }
17
18 protected void initialize() {
19 Robot.arm.initializeCounters();
20 }
21
22 protected void execute() {
23 }
24
25 protected boolean isFinished() {
26 return Robot.arm.isSwitch3Hit();
27 }
28
29 protected void end() {
30 System.out.println("Robot arm has reached level 3");
31 Robot.arm.stop();
32 }
33
34 protected void interrupted() {
35 end();
36 }
37 }