From: Shivani Ghanta Date: Sat, 14 Jan 2017 23:38:49 +0000 (-0800) Subject: Implement RunWinchContinuous X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=commitdiff_plain;h=a04ce2ff9270a861184425d08932987c166d4695 Implement RunWinchContinuous --- diff --git a/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java index ee075f2..05fd63a 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java +++ b/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java @@ -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(); } } diff --git a/src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java b/src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java index f024569..6c83816 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java +++ b/src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java @@ -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