]> git.taranathan.com Git - FRC2026.git/commitdiff
Spindexer toggle
authorWesley28w <wesleycwong@gmail.com>
Tue, 3 Mar 2026 18:18:23 +0000 (10:18 -0800)
committerWesley28w <wesleycwong@gmail.com>
Tue, 3 Mar 2026 18:18:23 +0000 (10:18 -0800)
src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java

index 216bce9dcf0003689109c3de7d499016dc0c569e..cd4a59308d363c042acbc716ef2eb399b402a806 100644 (file)
@@ -37,6 +37,7 @@ public class PS5ControllerDriverConfig extends BaseDriverConfig {
     private final PS5Controller controller = new PS5Controller(Constants.DRIVER_JOY);
     private final BooleanSupplier slowModeSupplier = () -> false;
     private boolean intakeBoolean = true;
+    private boolean spindexerBoolean = false;
     private Command autoShoot = null;
     private Shooter shooter;
     private Turret turret;
@@ -138,8 +139,16 @@ public class PS5ControllerDriverConfig extends BaseDriverConfig {
 
         // Spindexer
         if (spindexer != null) {
-            // Will only run if we are not calling default shoot command
-            controller.get(PS5Button.LEFT_TRIGGER).whileTrue(new RunSpindexer(spindexer, turret));
+            // Toggle spindexer
+            controller.get(PS5Button.LEFT_TRIGGER).onTrue(new InstantCommand(() -> {
+                if (spindexerBoolean) {
+                    spindexer.maxSpindexer();
+                    intakeBoolean = false;
+                } else {
+                    spindexer.stopSpindexer();
+                    intakeBoolean = true;
+                }
+            }));
         }
 
         // Auto shoot