create and fill raiseWristContinuous command
authorShaina Chen <shaina.sierra@gmail.com>
Wed, 10 Feb 2016 03:36:26 +0000 (19:36 -0800)
committerShaina Chen <shaina.sierra@gmail.com>
Wed, 10 Feb 2016 03:36:26 +0000 (19:36 -0800)
src/org/usfirst/frc/team3501/robot/commands/RaiseWristContinuous.java [new file with mode: 0755]

diff --git a/src/org/usfirst/frc/team3501/robot/commands/RaiseWristContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/RaiseWristContinuous.java
new file mode 100755 (executable)
index 0000000..1270c8e
--- /dev/null
@@ -0,0 +1,39 @@
+package org.usfirst.frc.team3501.robot.commands;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class RaiseWristContinuous extends Command {
+
+  private double speed;
+
+  public RaiseWristContinuous(double speed) {
+    requires(Robot.defenseArm);
+    this.speed = speed;
+  }
+
+  @Override
+  protected void initialize() {
+    Robot.defenseArm.setHandSpeed(speed);
+  }
+
+  @Override
+  protected void execute() {
+  }
+
+  @Override
+  protected boolean isFinished() {
+    return false;
+  }
+
+  @Override
+  protected void end() {
+    Robot.defenseArm.setHandSpeed(0);
+  }
+
+  @Override
+  protected void interrupted() {
+    end();
+  }
+}