From: niyatisriram Date: Wed, 10 Feb 2016 03:38:34 +0000 (-0800) Subject: Finish IntakeBall command X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=commitdiff_plain;h=2a4a0ca515407272730bba14eeff1558ee31a0d3 Finish IntakeBall command --- diff --git a/src/org/usfirst/frc/team3501/robot/commands/IntakeBall.java b/src/org/usfirst/frc/team3501/robot/commands/IntakeBall.java index 2c7688cc..7d90e44a 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/IntakeBall.java +++ b/src/org/usfirst/frc/team3501/robot/commands/IntakeBall.java @@ -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