From: Lauren Meier Date: Tue, 9 Feb 2016 04:08:43 +0000 (-0800) Subject: add commands to run winches continuously X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=commitdiff_plain;h=0d4d5dcbf4630c1eab65bc72dc292402c41ca748 add commands to run winches continuously --- diff --git a/src/org/usfirst/frc/team3501/robot/commands/WinchRobotDownContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/WinchRobotDownContinuous.java new file mode 100644 index 00000000..69935270 --- /dev/null +++ b/src/org/usfirst/frc/team3501/robot/commands/WinchRobotDownContinuous.java @@ -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 WinchRobotDownContinuous extends Command { + double winchDownSpeed; + + public WinchRobotDownContinuous(double speed) { + winchDownSpeed = speed; + if (winchDownSpeed > 1) + winchDownSpeed = 1; + if (winchDownSpeed < -1) + winchDownSpeed = -1; + } + + @Override + protected void initialize() { + Robot.scaler.runWinch(winchDownSpeed); + } + + @Override + protected void execute() { + } + + @Override + protected boolean isFinished() { + return true; + } + + @Override + protected void end() { + } + + @Override + protected void interrupted() { + } +} diff --git a/src/org/usfirst/frc/team3501/robot/commands/WinchRobotUpContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/WinchRobotUpContinuous.java new file mode 100644 index 00000000..ea35f24d --- /dev/null +++ b/src/org/usfirst/frc/team3501/robot/commands/WinchRobotUpContinuous.java @@ -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 WinchRobotUpContinuous extends Command { + double winchUpSpeed; + + public WinchRobotUpContinuous(double speed) { + winchUpSpeed = speed; + if (winchUpSpeed > 1) + winchUpSpeed = 1; + if (winchUpSpeed < -1) + winchUpSpeed = -1; + } + + @Override + protected void initialize() { + Robot.scaler.runWinch(winchUpSpeed); + } + + @Override + protected void execute() { + } + + @Override + protected boolean isFinished() { + return true; + } + + @Override + protected void end() { + } + + @Override + protected void interrupted() { + } +}