From ba67546bd81c1a2e48d1e8cc7f1516554f94c5b7 Mon Sep 17 00:00:00 2001 From: Wesley28w Date: Thu, 5 Mar 2026 09:29:41 -0800 Subject: [PATCH] i hate blogging --- src/main/java/frc/robot/commands/gpm/RunSpindexer.java | 3 ++- .../frc/robot/subsystems/spindexer/SpindexerConstants.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/commands/gpm/RunSpindexer.java b/src/main/java/frc/robot/commands/gpm/RunSpindexer.java index 6e9e2ee..3093817 100644 --- a/src/main/java/frc/robot/commands/gpm/RunSpindexer.java +++ b/src/main/java/frc/robot/commands/gpm/RunSpindexer.java @@ -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) { diff --git a/src/main/java/frc/robot/subsystems/spindexer/SpindexerConstants.java b/src/main/java/frc/robot/subsystems/spindexer/SpindexerConstants.java index 540ba7f..ec4bd9d 100644 --- a/src/main/java/frc/robot/subsystems/spindexer/SpindexerConstants.java +++ b/src/main/java/frc/robot/subsystems/spindexer/SpindexerConstants.java @@ -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 } -- 2.39.5