From 0c916244b8f31d6b2af81d27e92a7383504338e2 Mon Sep 17 00:00:00 2001 From: Shivani Ghanta Date: Mon, 16 Jan 2017 15:24:41 -0800 Subject: [PATCH] Change SetMotorValue --- .../robot/commands/climber/RunWinch.java | 13 ------ .../commands/climber/RunWinchContinuous.java | 1 - .../robot/commands/climber/StopWinch.java | 42 +++++++++++++++++++ .../team3501/robot/subsystems/Climber.java | 24 +++++++++++ 4 files changed, 66 insertions(+), 14 deletions(-) create mode 100644 src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java create mode 100644 src/org/usfirst/frc/team3501/robot/subsystems/Climber.java diff --git a/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinch.java b/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinch.java index c790a6c..c8b8b8d 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinch.java +++ b/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinch.java @@ -33,11 +33,7 @@ public class RunWinch extends Command { * value range is from -1 to 1 */ public RunWinch(double time, double motorVal) { -<<<<<<< a5147d5928f01620d8e10f2e9cdea079526d2db3 requires(Robot.getDriveTrain()); -======= - requires(Robot.getClimber()); ->>>>>>> Implement RunWinch this.time = time; this.motorVal = motorVal; } @@ -45,10 +41,6 @@ public class RunWinch extends Command { @Override protected void initialize() { timer.start(); -<<<<<<< a5147d5928f01620d8e10f2e9cdea079526d2db3 -======= - Robot.getClimber().setMotorValues(motorVal, motorVal); ->>>>>>> Implement RunWinch } @Override @@ -64,12 +56,7 @@ public class RunWinch extends Command { @Override protected void end() { -<<<<<<< a5147d5928f01620d8e10f2e9cdea079526d2db3 Robot.getDriveTrain().stop(); - -======= - Robot.getClimber().stop(); ->>>>>>> Implement RunWinch } @Override 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 1a9e2d6..e0a6700 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java +++ b/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java @@ -34,7 +34,6 @@ public class RunWinchContinuous extends Command { @Override protected void initialize() { Robot.getDriveTrain().setMotorValues(motorVal, motorVal); - } @Override diff --git a/src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java b/src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java new file mode 100644 index 0000000..31a5b55 --- /dev/null +++ b/src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java @@ -0,0 +1,42 @@ +package org.usfirst.frc.team3501.robot.commands.climber; + +import org.usfirst.frc.team3501.robot.Robot; + +import edu.wpi.first.wpilibj.command.Command; + +/** + * Stops the winch + * + * @author shivanighanta + * + */ +public class StopWinch extends Command { + + public StopWinch() { + requires(Robot.getClimber()); + } + + @Override + protected void initialize() { + } + + @Override + protected void execute() { + } + + @Override + protected boolean isFinished() { + return true; + } + + @Override + protected void end() { + Robot.getClimber().stop(); + + } + + @Override + protected void interrupted() { + end(); + } +} diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Climber.java b/src/org/usfirst/frc/team3501/robot/subsystems/Climber.java new file mode 100644 index 0000000..3426dad --- /dev/null +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Climber.java @@ -0,0 +1,24 @@ +package org.usfirst.frc.team3501.robot.subsystems; + +public class Climber { + private static Climber climber; + + private Climber() { + + } + + public static Climber getClimber() { + if (climber == null) { + climber = new Climber(); + } + return climber; + } + + public void stop() { + setMotorValues(0); + } + + public void setMotorValues(final double val) { + + } +} -- 2.30.2