From d7042bec1cddc809132fcc233ba3320b0b6681d9 Mon Sep 17 00:00:00 2001 From: Nadia Anees Date: Fri, 10 Feb 2017 19:28:40 -0800 Subject: [PATCH] Only run indexwheel if flywheel is running --- .../frc/team3501/robot/commands/shooter/RunIndexWheel.java | 5 ++++- .../robot/commands/shooter/RunIndexWheelContinuous.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheel.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheel.java index 6838354..3f8baa0 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheel.java +++ b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheel.java @@ -38,7 +38,10 @@ public class RunIndexWheel extends Command { // Called repeatedly when this Command is scheduled to run @Override protected void execute() { - shooter.setIndexWheelMotorVal(shooter.DEFAULT_INDEXING_SPEED); + double shooterSpeed = shooter.getShooterRPM(); + if (shooterSpeed > 0) { + shooter.setIndexWheelMotorVal(shooter.DEFAULT_INDEXING_SPEED); + } } // Called once after isFinished returns true diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java index cb56bf4..f958be7 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java +++ b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java @@ -38,7 +38,10 @@ public class RunIndexWheelContinuous extends Command { // Called repeatedly when this Command is scheduled to run @Override protected void execute() { - shooter.setIndexWheelMotorVal(shooter.DEFAULT_INDEXING_SPEED); + double shooterSpeed = shooter.getShooterRPM(); + if (shooterSpeed > 0) { + shooter.setIndexWheelMotorVal(shooter.DEFAULT_INDEXING_SPEED); + } } // Called once after isFinished returns true -- 2.30.2