Uses arrays and sends message when a specific limitswitch is hit
[3501/2015-FRC-Spark] / src / org / usfirst / frc3501 / RiceCatRobot / commands / MoveArmToLevel2.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 MoveArmToLevel2 extends Command {
8 Arm arm;
9 double slowSpeed = 0.2;
10 public MoveArmToLevel2() {
11 if(arm.getArmSpeed() == 0.0) {
12 arm.setArmSpeeds(slowSpeed);
13 }
14 }
15
16 protected void initialize() {
17 arm.initializeCounters();
18 }
19
20 protected void execute() {
21 }
22
23 protected boolean isFinished() {
24 return arm.isSwitch2Hit();
25 }
26
27 protected void end() {
28 System.out.println("Robot arm has reached level 2");
29 }
30
31 protected void interrupted() {
32 end();
33 }
34 }