From: Kevin Zhang Date: Mon, 15 Feb 2016 00:30:20 +0000 (-0800) Subject: Correct methods in scaler and edit runwinchcontinuous X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=commitdiff_plain;h=afeba6b993f8855cba4606e9fa38220525c17c24 Correct methods in scaler and edit runwinchcontinuous --- diff --git a/src/org/usfirst/frc/team3501/robot/commands/RunWinchContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/RunWinchContinuous.java deleted file mode 100644 index 304c983a..00000000 --- a/src/org/usfirst/frc/team3501/robot/commands/RunWinchContinuous.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.usfirst.frc.team3501.robot.commands; - -import org.usfirst.frc.team3501.robot.Robot; - -import edu.wpi.first.wpilibj.command.Command; - -/*** - * This command will run the winch motor continuously until the button - * tirggering it is released. - * - * pre-condition: This command must be run by a button in OI with method - * whileHeld(). The robot must be attached to the tower rung. - * - * post-condition: winch motor set to a specified speed. - * - * @author Lauren - * - */ - -public class RunWinchContinuous extends Command { - private double winchUpSpeed; - - public RunWinchContinuous(double speed) { - requires(Robot.scaler); - winchUpSpeed = speed; - } - - @Override - protected void initialize() { - Robot.scaler.runWinch(winchUpSpeed); - } - - @Override - protected void execute() { - } - - @Override - protected boolean isFinished() { - return true; - } - - @Override - protected void end() { - Robot.scaler.stopWinch(); - } - - @Override - protected void interrupted() { - end(); - } -} diff --git a/src/org/usfirst/frc/team3501/robot/commands/scaler/RunWinchContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/scaler/RunWinchContinuous.java new file mode 100644 index 00000000..304c983a --- /dev/null +++ b/src/org/usfirst/frc/team3501/robot/commands/scaler/RunWinchContinuous.java @@ -0,0 +1,51 @@ +package org.usfirst.frc.team3501.robot.commands; + +import org.usfirst.frc.team3501.robot.Robot; + +import edu.wpi.first.wpilibj.command.Command; + +/*** + * This command will run the winch motor continuously until the button + * tirggering it is released. + * + * pre-condition: This command must be run by a button in OI with method + * whileHeld(). The robot must be attached to the tower rung. + * + * post-condition: winch motor set to a specified speed. + * + * @author Lauren + * + */ + +public class RunWinchContinuous extends Command { + private double winchUpSpeed; + + public RunWinchContinuous(double speed) { + requires(Robot.scaler); + winchUpSpeed = speed; + } + + @Override + protected void initialize() { + Robot.scaler.runWinch(winchUpSpeed); + } + + @Override + protected void execute() { + } + + @Override + protected boolean isFinished() { + return true; + } + + @Override + protected void end() { + Robot.scaler.stopWinch(); + } + + @Override + protected void interrupted() { + end(); + } +}