package org.usfirst.frc.team3501.robot.commands.climber;
+import org.usfirst.frc.team3501.robot.Robot;
+
+import com.sun.glass.ui.Timer;
+
import edu.wpi.first.wpilibj.command.Command;
/**
*
*/
public class RunWinch extends Command {
+ Timer timer;
private double time;
private double motorVal;
public RunWinch(double time, double motorVal) {
+ requires(Robot.getClimber());
this.time = time;
this.motorVal = motorVal;
}
@Override
protected void initialize() {
+ timer.start();
+ Robot.getClimber().setMotorValues(motorVal, motorVal);
}
@Override
@Override
protected boolean isFinished() {
- return false;
+ return timer.get() >= time;
}
@Override
protected void end() {
-
+ Robot.getClimber().stop();
}
@Override
protected void interrupted() {
+ end();
}
}