1 package org
.usfirst
.frc
.team3501
.robot
.commands
.climber
;
3 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
5 import com
.sun
.glass
.ui
.Timer
;
7 import edu
.wpi
.first
.wpilibj
.command
.Command
;
10 * This command runs the winch for a given motor value and time in seconds
13 * value range is from -1 to 1
16 * @author shivanighanta
19 public class RunWinch
extends Command
{
22 private double motorVal
;
24 public RunWinch(double time
, double motorVal
) {
25 requires(Robot
.getClimber());
27 this.motorVal
= motorVal
;
31 protected void initialize() {
33 Robot
.getClimber().setMotorValue(motorVal
);
37 protected void execute() {
42 protected boolean isFinished() {
43 return timer
.get() >= time
;
47 protected void end() {
48 Robot
.getClimber().stop();
52 protected void interrupted() {