X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc3501%2FRiceCatRobot%2Fcommands%2FMoveArmFor.java;h=4e97d1b3084cc34e8bebcb426a5af9eee8a91746;hb=e3bfff965c6d5a25b0d98b12b73fbf7eed623326;hp=c082b2f5ae56cb285ec04f18e74b5f21f4beab7b;hpb=b5f932ecccf219b28cbebf44c8896347621f6364;p=3501%2F2015-FRC-Spark diff --git a/src/org/usfirst/frc3501/RiceCatRobot/commands/MoveArmFor.java b/src/org/usfirst/frc3501/RiceCatRobot/commands/MoveArmFor.java index c082b2f..4e97d1b 100644 --- a/src/org/usfirst/frc3501/RiceCatRobot/commands/MoveArmFor.java +++ b/src/org/usfirst/frc3501/RiceCatRobot/commands/MoveArmFor.java @@ -13,48 +13,48 @@ import edu.wpi.first.wpilibj.command.Command; * */ public class MoveArmFor extends Command { - private double seconds; - private Timer timer; - private Direction direction; - - /* - * @param Direction must be up or down - */ - public MoveArmFor(double seconds, Direction direction) { - this.seconds = seconds; - this.direction = direction; + private double seconds; + private Timer timer; + private Direction direction; + + /* + * @param Direction must be up or down + */ + public MoveArmFor(double seconds, Direction direction) { + this.seconds = seconds; + this.direction = direction; + } + + @Override + protected void initialize() { + timer = new Timer(); + timer.start(); + } + + @Override + protected void execute() { + if (direction == Direction.UP) { + Robot.arm.setArmSpeeds(-RobotMap.ARM_LOW_SPEED); + } else if (direction == Direction.DOWN) { + Robot.arm.setArmSpeeds(RobotMap.ARM_LOW_SPEED); } + } - @Override - protected void initialize() { - timer = new Timer(); - timer.start(); - } - - @Override - protected void execute() { - if (direction == Direction.UP) { - Robot.arm.setArmSpeeds(-RobotMap.ARM_LOW_SPEED); - } else if (direction == Direction.DOWN) { - Robot.arm.setArmSpeeds(RobotMap.ARM_LOW_SPEED); - } - } - - @Override - protected boolean isFinished() { - if (timer.get() > seconds) { - Robot.arm.setArmSpeeds(0); - } - return timer.get() > seconds; - } - - @Override - protected void end() { - Robot.arm.setArmSpeeds(0); - } - - @Override - protected void interrupted() { - end(); + @Override + protected boolean isFinished() { + if (timer.get() > seconds) { + Robot.arm.setArmSpeeds(0); } + return timer.get() > seconds; + } + + @Override + protected void end() { + Robot.arm.setArmSpeeds(0); + } + + @Override + protected void interrupted() { + end(); + } }