write ExpellBall code using photogate tests
authorLauren Meier <meier.lauren@gmail.com>
Wed, 10 Feb 2016 03:36:05 +0000 (19:36 -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/ExpelBall.java

index 71f877327c7a672bbeedfa6b59761076a8c4fcc3..573bd9048cdef6fbabb75ed98b343494cd2f6bd4 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 ExpelBall extends Command {
@@ -9,17 +11,17 @@ public class ExpelBall extends Command {
 
   @Override
   protected void initialize() {
-
+    if (Robot.photogate.isBallPresent())
+      Robot.intakeArm.outputBall();
   }
 
   @Override
   protected void execute() {
-
   }
 
   @Override
   protected boolean isFinished() {
-    return true;
+    return !Robot.photogate.isBallPresent();
   }
 
   @Override