From 2a4a0ca515407272730bba14eeff1558ee31a0d3 Mon Sep 17 00:00:00 2001 From: niyatisriram Date: Tue, 9 Feb 2016 19:38:34 -0800 Subject: [PATCH] Finish IntakeBall command --- src/org/usfirst/frc/team3501/robot/commands/IntakeBall.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.30.2