X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fdriving%2FToggleGear.java;h=3a17440b1e920cd182db1cbc87d20c003296346e;hb=e4082bee56fa6cbcbaa062d17ae17c280dec40c5;hp=ce7489096ec57d9443c0e17f1cc5da1ec71ad9f3;hpb=a6695a850d7f394734c77d75008774ce97063267;p=3501%2F2017steamworks diff --git a/src/org/usfirst/frc/team3501/robot/commands/driving/ToggleGear.java b/src/org/usfirst/frc/team3501/robot/commands/driving/ToggleGear.java index ce74890..3a17440 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/driving/ToggleGear.java +++ b/src/org/usfirst/frc/team3501/robot/commands/driving/ToggleGear.java @@ -29,10 +29,17 @@ public class ToggleGear extends Command { protected void execute() { Value leftGearPistonValue = driveTrain.getLeftGearPistonValue(); Value rightGearPistonValue = driveTrain.getRightGearPistonValue(); + if (leftGearPistonValue == Constants.DriveTrain.LOW_GEAR) { - driveTrain.setHighGear(); + driveTrain.setHighGear(driveTrain.getLeftPiston()); + } else { + driveTrain.setLowGear(driveTrain.getLeftPiston()); + } + + if (rightGearPistonValue == Constants.DriveTrain.LOW_GEAR) { + driveTrain.setHighGear(driveTrain.getRightPiston()); } else { - driveTrain.setLowGear(); + driveTrain.setLowGear(driveTrain.getRightPiston()); } }