1 package org
.usfirst
.frc
.team3501
.robot
.commands
.intake
;
3 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
5 import edu
.wpi
.first
.wpilibj
.Timer
;
6 import edu
.wpi
.first
.wpilibj
.command
.Command
;
10 * Starts running the intake for a specific period of time that the user inputs.
14 public class RunIntake
extends Command
{
15 private double timeToMove
;
22 public RunIntake(double timeToMove
) {
23 requires(Robot
.getIntake());
25 this.timeToMove
= timeToMove
;
29 protected boolean isFinished() {
30 return timer
.get() >= timeToMove
;
33 // Called just before this Command runs the first time
35 protected void initialize() {
39 // Called repeatedly when this Command is scheduled to run
41 protected void execute() {
42 Robot
.getIntake().runIntake();
45 // Called once after isFinished returns true
47 protected void end() {
49 Robot
.getIntake().stopIntake();
52 // Called when another command which requires one or more of the same
53 // subsystems is scheduled to run
55 protected void interrupted() {