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
;
9 * Reverses the intake roller for a specified amount of time in seconds
11 * parameters: time to run intake
13 public class ReverseIntake
extends Command
{
14 private double timeToMove
;
17 public ReverseIntake(double timeToMove
) {
18 requires(Robot
.getIntake());
20 this.timeToMove
= timeToMove
;
23 // Called just before this Command runs the first time
25 protected void initialize() {
29 // Called repeatedly when this Command is scheduled to run
31 protected void execute() {
32 Robot
.getIntake().runReverseIntake();
35 // Make this return true when this Command no longer needs to run execute()
37 protected boolean isFinished() {
38 return timer
.get() >= timeToMove
;
41 // Called once after isFinished returns true
43 protected void end() {
44 Robot
.getIntake().stopIntake();
47 // Called when another command which requires one or more of the same
48 // subsystems is scheduled to run
50 protected void interrupted() {