make MoveToLevel
authorKevin Zhang <kevin.zhang.13499@gmail.com>
Tue, 17 Nov 2015 05:00:34 +0000 (21:00 -0800)
committerKevin Zhang <kevin.zhang.13499@gmail.com>
Tue, 17 Nov 2015 05:00:34 +0000 (21:00 -0800)
src/org/usfirst/frc3501/RiceCatRobot/commands/MoveToLevel.java [new file with mode: 0644]
src/org/usfirst/frc3501/RiceCatRobot/commands/MoveUpLevel.java [deleted file]

diff --git a/src/org/usfirst/frc3501/RiceCatRobot/commands/MoveToLevel.java b/src/org/usfirst/frc3501/RiceCatRobot/commands/MoveToLevel.java
new file mode 100644 (file)
index 0000000..ee10d1a
--- /dev/null
@@ -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 (file)
index 55096fb..0000000
+++ /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;
-       }
-
-}