From: Nadia Anees Date: Sat, 11 Feb 2017 03:28:40 +0000 (-0800) Subject: Only run indexwheel if flywheel is running X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=commitdiff_plain;h=d7042bec1cddc809132fcc233ba3320b0b6681d9;hp=0a4e4ffd519bb48e18bfce81f97b945ab31a7a9a Only run indexwheel if flywheel is running --- 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