From: Kevin Zhang Date: Tue, 17 Nov 2015 05:00:34 +0000 (-0800) Subject: make MoveToLevel X-Git-Url: http://challenge-bot.com/repos/?a=commitdiff_plain;h=30a7f376a71d1fecdd501c8f124be2e3b4162949;p=3501%2F2015-FRC-Spark make MoveToLevel --- diff --git a/src/org/usfirst/frc3501/RiceCatRobot/commands/MoveToLevel.java b/src/org/usfirst/frc3501/RiceCatRobot/commands/MoveToLevel.java new file mode 100644 index 0000000..ee10d1a --- /dev/null +++ b/src/org/usfirst/frc3501/RiceCatRobot/commands/MoveToLevel.java @@ -0,0 +1,42 @@ +package org.usfirst.frc3501.RiceCatRobot.commands; + +import org.usfirst.frc3501.RiceCatRobot.Robot; +import org.usfirst.frc3501.RiceCatRobot.RobotMap; + +import edu.wpi.first.wpilibj.command.Command; + +public class MoveToLevel extends Command{ + + int targetLevel, currentLevel; + + public MoveToLevel(int targetLevel) { + this.targetLevel = targetLevel; + } + + @Override + protected void initialize() { + + } + + @Override + protected void execute() { + Robot.arm.setArmSpeeds(RobotMap.ARM_LOW_SPEED); + } + + @Override + protected boolean isFinished() { + if(currentLevel == targetLevel) return true; + return false; + } + + @Override + protected void end() { + Robot.arm.setArmSpeeds(0); + } + + @Override + protected void interrupted() { + end(); + } + +} diff --git a/src/org/usfirst/frc3501/RiceCatRobot/commands/MoveUpLevel.java b/src/org/usfirst/frc3501/RiceCatRobot/commands/MoveUpLevel.java deleted file mode 100644 index 55096fb..0000000 --- a/src/org/usfirst/frc3501/RiceCatRobot/commands/MoveUpLevel.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.usfirst.frc3501.RiceCatRobot.commands; - -import edu.wpi.first.wpilibj.command.Command; - -public class MoveUpLevel extends Command{ - - int targetLevel, currentLevel; - - public MoveUpLevel(int targetLevel) { - this.targetLevel = targetLevel; - } - - @Override - protected void end() { - // TODO Auto-generated method stub - - } - - @Override - protected void execute() { - // TODO Auto-generated method stub - - } - - @Override - protected void initialize() { - // TODO Auto-generated method stub - - } - - @Override - protected void interrupted() { - // TODO Auto-generated method stub - - } - - @Override - protected boolean isFinished() { - // TODO Auto-generated method stub - return false; - } - -}