0e980a49e3b3bb02ed2db8a95d6f866d568f893f
1 package org
.usfirst
.frc
.team3501
.robot
.commands
.climber
;
3 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
5 import edu
.wpi
.first
.wpilibj
.command
.Command
;
8 * This command runs the winch at a specified speed and time in seconds when the
9 * button triggering it is pressed. This command also makes the drive train
10 * motors run because the winch is controlled by the drive train.
12 * pre-condition: This command is run by a button in OI. The robot must be
13 * attached to the rope.
15 * post-condition: Winch motor set to a specified speed for a specified time.
18 * value range is from -1 to 1
21 * @author shivanighanta
25 public class RunWinch
extends Command
{
27 private double motorVal
;
30 * See JavaDoc comment in class for details
33 * time in seconds to run the winch
35 * value range is from -1 to 1
37 public RunWinch(double time
, double motorVal
) {
38 requires(Robot
.getDriveTrain());
40 this.motorVal
= motorVal
;
44 protected void initialize() {
48 protected void execute() {
49 Robot
.getDriveTrain().setMotorValues(motorVal
, motorVal
);
54 protected boolean isFinished() {
55 return timeSinceInitialized() >= time
;
59 protected void end() {
60 Robot
.getDriveTrain().stop();
64 protected void interrupted() {