From 694c9fc9672f15badfa162e45706688e85e47dbc Mon Sep 17 00:00:00 2001 From: Lauren Meier Date: Sat, 13 Feb 2016 15:51:26 -0800 Subject: [PATCH] add stopWinch() method to Scaler to use in RunWinchContinuous --- src/org/usfirst/frc/team3501/robot/Constants.java | 3 +++ .../frc/team3501/robot/commands/RunWinchContinuous.java | 3 +-- src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index e12b1e44..65fca516 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -64,6 +64,9 @@ public class Constants { // Winch port public final static int WINCH_MOTOR = 0; + // Winch speeds + public final static double WINCH_STOP_SPEED = 00; + } public static class Shooter { diff --git a/src/org/usfirst/frc/team3501/robot/commands/RunWinchContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/RunWinchContinuous.java index 63ff149f..304c983a 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/RunWinchContinuous.java +++ b/src/org/usfirst/frc/team3501/robot/commands/RunWinchContinuous.java @@ -18,7 +18,6 @@ import edu.wpi.first.wpilibj.command.Command; */ public class RunWinchContinuous extends Command { - private final double STOP_SPEED = 0.0; private double winchUpSpeed; public RunWinchContinuous(double speed) { @@ -42,7 +41,7 @@ public class RunWinchContinuous extends Command { @Override protected void end() { - Robot.scaler.runWinch(STOP_SPEED); + Robot.scaler.stopWinch(); } @Override diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java b/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java index ee7b28da..c6d40077 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java @@ -45,6 +45,10 @@ public class Scaler extends Subsystem { winch.set(speed); } + public void stopWinch() { + runWinch(Constants.Scaler.WINCH_STOP_SPEED); + } + /*** * This method returns boolean value true or false on whether piston is * extended or not. -- 2.30.2