From: Shaina Chen Date: Tue, 16 Feb 2016 18:52:53 +0000 (-0800) Subject: add timeout variable X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=commitdiff_plain;h=43abf0e4979a661c0c003be7d9da9bde93dc9b40 add timeout variable --- diff --git a/src/org/usfirst/frc/team3501/robot/commands/scaler/RunWinchContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/scaler/RunWinchContinuous.java index 8f3f4281..5b45d0b4 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/scaler/RunWinchContinuous.java +++ b/src/org/usfirst/frc/team3501/robot/commands/scaler/RunWinchContinuous.java @@ -19,14 +19,17 @@ import edu.wpi.first.wpilibj.command.Command; public class RunWinchContinuous extends Command { private double winchUpSpeed; + private int timeoutAmount; - public RunWinchContinuous(double speed) { + public RunWinchContinuous(double speed, int timeout) { requires(Robot.scaler); winchUpSpeed = speed; + timeoutAmount = timeout; } @Override protected void initialize() { + this.setTimeout(timeoutAmount); Robot.scaler.runWinch(winchUpSpeed); } @@ -36,7 +39,7 @@ public class RunWinchContinuous extends Command { @Override protected boolean isFinished() { - return true; + return this.isTimedOut(); } @Override