fix TimeRunIntake
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / intakearm / TimeRunIntake.java
1 package org.usfirst.frc.team3501.robot.commands.intakearm;
2
3 import org.usfirst.frc.team3501.robot.Robot;
4
5 import edu.wpi.first.wpilibj.Timer;
6 import edu.wpi.first.wpilibj.command.Command;
7
8 /**
9 *
10 */
11 public class TimeRunIntake extends Command {
12 Timer timer;
13 private double time;
14
15 public TimeRunIntake(double time) {
16 timer = new Timer();
17 this.time = time;
18 }
19
20 @Override
21 protected void initialize() {
22 timer.start();
23 Robot.intakeArm.intakeBall();
24 }
25
26 @Override
27 protected void execute() {
28 }
29
30 @Override
31 protected boolean isFinished() {
32 return timer.get() >= time;
33 }
34
35 @Override
36 protected void end() {
37 Robot.intakeArm.stopRollers();
38 }
39
40 @Override
41 protected void interrupted() {
42 end();
43 }
44 }