X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fintakearm%2FRunIntake.java;h=649ed5cf503232435539b6600a36f359a4d73f95;hb=53b6c82dab184bcfa94e27f507e390e01d9ac476;hp=c69b350631e777c30fa65a792f8d1a2928092f18;hpb=ba29a57aaf0f4175ef20d4ee64ac7ad8c799327d;p=3501%2Fstronghold-2016 diff --git a/src/org/usfirst/frc/team3501/robot/commands/intakearm/RunIntake.java b/src/org/usfirst/frc/team3501/robot/commands/intakearm/RunIntake.java index c69b3506..649ed5cf 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/intakearm/RunIntake.java +++ b/src/org/usfirst/frc/team3501/robot/commands/intakearm/RunIntake.java @@ -1,6 +1,6 @@ package org.usfirst.frc.team3501.robot.commands.intakearm; -import org.usfirst.frc.team3501.robot.Constants; +import org.usfirst.frc.team3501.robot.Constants.IntakeArm; import org.usfirst.frc.team3501.robot.Robot; import edu.wpi.first.wpilibj.command.Command; @@ -15,9 +15,9 @@ public class RunIntake extends Command { @Override protected void initialize() { - if (direction == Constants.IntakeArm.IN) + if (direction == IntakeArm.IN) Robot.intakeArm.intakeBall(); - else if (direction == Constants.IntakeArm.OUT) + else if (direction == IntakeArm.OUT) Robot.intakeArm.outputBall(); else Robot.intakeArm.stopRollers(); @@ -25,6 +25,8 @@ public class RunIntake extends Command { @Override protected void execute() { + if (Photogate.ballState()) + Robot.intakeArm.outputBall(); } @Override @@ -40,4 +42,9 @@ public class RunIntake extends Command { protected void interrupted() { } + // while holding right trigger, intake intakes + // it intakes until it sees the ball with the photogate + // as soon as it sees the ball, it outtakes for 0.2 seconds. + // after this happens, the right trigger does nothing for 2 seconds + }