]> git.taranathan.com Git - FRC2026.git/commitdiff
i hate blogging
authorWesley28w <wesleycwong@gmail.com>
Thu, 5 Mar 2026 17:29:41 +0000 (09:29 -0800)
committerWesley28w <wesleycwong@gmail.com>
Thu, 5 Mar 2026 17:29:41 +0000 (09:29 -0800)
src/main/java/frc/robot/commands/gpm/RunSpindexer.java
src/main/java/frc/robot/subsystems/spindexer/SpindexerConstants.java

index 6e9e2ee4ccf2dcdc83d919e5bac196b59d14c613..3093817e85e95fe47b77c56488dacb3317010fe5 100644 (file)
@@ -10,7 +10,7 @@ import frc.robot.subsystems.turret.Turret;
 public class RunSpindexer extends Command {
     private Spindexer spindexer;
     private Turret turret;
-    private Debouncer jam_debouncer = new Debouncer(0.3, DebounceType.kFalling);
+    private Debouncer jam_debouncer = new Debouncer(SpindexerConstants.JAM_DEBOUNCE_TIME, DebounceType.kFalling);
     private boolean reversing = false;
     public RunSpindexer(Spindexer spindexer, Turret turret){
         this.spindexer = spindexer;
@@ -28,6 +28,7 @@ public class RunSpindexer extends Command {
         boolean jammed = spindexer.getStatorCurrent() > SpindexerConstants.JAM_CURRENT_THRESHOLD;
         if (jammed) {
             reversing = true;
+            jam_debouncer.calculate(false); 
         }
 
         if (reversing) {
index 540ba7f3ac08d8f00abf146ed2a42fe9e67680b4..ec4bd9d68715ae4738291135fbb93007121a994e 100644 (file)
@@ -8,4 +8,5 @@ public class SpindexerConstants {
     public static final double CURRENT_SPIKE_LIMIT = 80;
     public static final double CURRENT_TIME_LIMIT = 1.0; //s
     public static final double JAM_CURRENT_THRESHOLD = 9.0; // A
+    public static final double JAM_DEBOUNCE_TIME = 0.3; // seconds
 }