5452073515b0fb7d719b1d2df15200d682595dcf
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
;
18 public RunIntake(double timeToMove
) {
19 requires(Robot
.getIntake());
21 this.timeToMove
= timeToMove
;
25 protected boolean isFinished() {
26 return timer
.get() >= timeToMove
;
29 // Called just before this Command runs the first time
31 protected void initialize() {
35 // Called repeatedly when this Command is scheduled to run
37 protected void execute() {
38 Robot
.getIntake().setSpeed(Robot
.getIntake().INTAKE_SPEED
);
41 // Called once after isFinished returns true
43 protected void end() {
46 // Called when another command which requires one or more of the same
47 // subsystems is scheduled to run
49 protected void interrupted() {