From a04ce2ff9270a861184425d08932987c166d4695 Mon Sep 17 00:00:00 2001 From: Shivani Ghanta Date: Sat, 14 Jan 2017 15:38:49 -0800 Subject: [PATCH] Implement RunWinchContinuous --- .../team3501/robot/commands/climber/RunWinchContinuous.java | 6 +++++- .../frc/team3501/robot/commands/climber/StopWinch.java | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) 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 -- 2.30.2