1 package org
.usfirst
.frc
.team3501
.robot
.commands
.intakearm
;
3 import org
.usfirst
.frc
.team3501
.robot
.Constants
.IntakeArm
;
4 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
6 import edu
.wpi
.first
.wpilibj
.command
.Command
;
8 public class RunIntake
extends Command
{
11 public RunIntake(int direction
) {
12 requires(Robot
.intakeArm
);
13 this.direction
= direction
;
17 protected void initialize() {
18 if (direction
== IntakeArm
.IN
)
19 Robot
.intakeArm
.intakeBall();
20 else if (direction
== IntakeArm
.OUT
)
21 Robot
.intakeArm
.outputBall();
23 Robot
.intakeArm
.stopRollers();
27 protected void execute() {
31 protected boolean isFinished() {
36 protected void end() {
40 protected void interrupted() {
43 // while holding right trigger, intake intakes
44 // it intakes until it sees the ball with the photogate
45 // as soon as it sees the ball, it outtakes for 0.2 seconds.
46 // after this happens, the right trigger does nothing for 2 seconds