use wait command and move if statements from shoot at high goal to resetcatapult
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / intakearm / RunIntake.java
index 42ed83fc3f38b5a0c0970f52aa1103fe6c0af63a..649ed5cf503232435539b6600a36f359a4d73f95 100644 (file)
@@ -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,14 +15,18 @@ public class RunIntake extends Command {
 
   @Override
   protected void initialize() {
-    if (direction == Constants.IntakeArm.IN)
+    if (direction == IntakeArm.IN)
       Robot.intakeArm.intakeBall();
-    else
+    else if (direction == IntakeArm.OUT)
       Robot.intakeArm.outputBall();
+    else
+      Robot.intakeArm.stopRollers();
   }
 
   @Override
   protected void execute() {
+    if (Photogate.ballState())
+      Robot.intakeArm.outputBall();
   }
 
   @Override
@@ -38,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
+
 }