Implement RunWinchContinuous
authorShivani Ghanta <shivani.oghanta@gmail.com>
Sat, 14 Jan 2017 23:38:49 +0000 (15:38 -0800)
committerShivani Ghanta <shivani.oghanta@gmail.com>
Sat, 21 Jan 2017 22:27:37 +0000 (14:27 -0800)
src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java
src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java

index ee075f29f6ac7b5bda8c1d5a2d23b619d46b16c6..05fd63ae1c39b7158c2a1dc5ab3396801f192ba9 100644 (file)
@@ -1,5 +1,7 @@
 package org.usfirst.frc.team3501.robot.commands.climber;
 
+import org.usfirst.frc.team3501.robot.Robot;
+
 import edu.wpi.first.wpilibj.command.Command;
 
 /**
@@ -12,6 +14,7 @@ public class RunWinchContinuous extends Command {
   private double motorVal;
 
   public RunWinchContinuous(double motorVal) {
+    requires(Robot.getClimber());
     this.motorVal = motorVal;
   }
 
@@ -31,10 +34,11 @@ public class RunWinchContinuous extends Command {
 
   @Override
   protected void end() {
-
+    Robot.getClimber().stop();
   }
 
   @Override
   protected void interrupted() {
+    end();
   }
 }
index f024569b545fec1f707fe665e07413610c2f6121..6c83816c37cc9102e23bed14b23b3e421701c042 100644 (file)
@@ -1,5 +1,7 @@
 package org.usfirst.frc.team3501.robot.commands.climber;
 
+import org.usfirst.frc.team3501.robot.Robot;
+
 import edu.wpi.first.wpilibj.command.Command;
 
 /**
@@ -11,6 +13,7 @@ import edu.wpi.first.wpilibj.command.Command;
 public class StopWinch extends Command {
 
   public StopWinch() {
+    requires(Robot.getClimber());
   }
 
   @Override