Finish IntakeBall command
authorniyatisriram <niyatisriram@gmail.com>
Wed, 10 Feb 2016 03:38:34 +0000 (19:38 -0800)
committerLauren Meier <meier.lauren@gmail.com>
Sat, 13 Feb 2016 22:39:37 +0000 (14:39 -0800)
src/org/usfirst/frc/team3501/robot/commands/IntakeBall.java

index 2c7688cc2163be077615e054d9840391dd5c4d99..7d90e44abef6e99d3e9b2ec819fe9b9ee54d9555 100644 (file)
@@ -1,5 +1,7 @@
 package org.usfirst.frc.team3501.robot.commands;
 
+import org.usfirst.frc.team3501.robot.Robot;
+
 import edu.wpi.first.wpilibj.command.Command;
 
 public class IntakeBall extends Command {
@@ -9,6 +11,8 @@ public class IntakeBall extends Command {
 
   @Override
   protected void initialize() {
+    if (!Robot.photogate.isBallPresent())
+      Robot.intakeArm.intakeBall();
 
   }
 
@@ -19,7 +23,7 @@ public class IntakeBall extends Command {
 
   @Override
   protected boolean isFinished() {
-    return true;
+    return Robot.photogate.isBallPresent();
   }
 
   @Override