1 package org
.usfirst
.frc3501
.RiceCatRobot
.commands
;
3 import org
.usfirst
.frc3501
.RiceCatRobot
.Robot
;
4 import org
.usfirst
.frc3501
.RiceCatRobot
.RobotMap
;
5 import org
.usfirst
.frc3501
.RiceCatRobot
.RobotMap
.Direction
;
7 import edu
.wpi
.first
.wpilibj
.Timer
;
8 import edu
.wpi
.first
.wpilibj
.command
.Command
;
11 * This command takes a time in seconds which is how long it should run to move
15 public class MoveArmFor
extends Command
{
16 private double seconds
;
18 private Direction direction
;
21 * @param Direction must be up or down
23 public MoveArmFor(double seconds
, Direction direction
) {
24 this.seconds
= seconds
;
25 this.direction
= direction
;
29 protected void initialize() {
35 protected void execute() {
36 if (direction
== Direction
.UP
) {
37 Robot
.arm
.setArmSpeeds(-RobotMap
.ARM_LOW_SPEED
);
38 } else if (direction
== Direction
.DOWN
) {
39 Robot
.arm
.setArmSpeeds(RobotMap
.ARM_LOW_SPEED
);
44 protected boolean isFinished() {
45 if (timer
.get() > seconds
) {
46 Robot
.arm
.setArmSpeeds(0);
48 return timer
.get() > seconds
;
52 protected void end() {
53 Robot
.arm
.setArmSpeeds(0);
57 protected void interrupted() {