From 2d4e241db703eb3da28d1b526016a86efcbb1e2e Mon Sep 17 00:00:00 2001 From: moo Date: Fri, 17 Apr 2026 14:56:15 -0700 Subject: [PATCH] better stuff --- .../frc/robot/subsystems/spindexer/Spindexer.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/spindexer/Spindexer.java b/src/main/java/frc/robot/subsystems/spindexer/Spindexer.java index e9cb913..f195e2c 100644 --- a/src/main/java/frc/robot/subsystems/spindexer/Spindexer.java +++ b/src/main/java/frc/robot/subsystems/spindexer/Spindexer.java @@ -2,6 +2,7 @@ package frc.robot.subsystems.spindexer; import com.ctre.phoenix6.configs.CurrentLimitsConfigs; import com.ctre.phoenix6.controls.DutyCycleOut; +import com.ctre.phoenix6.controls.VoltageOut; import com.ctre.phoenix6.hardware.TalonFX; import org.littletonrobotics.junction.Logger; @@ -66,18 +67,18 @@ public class Spindexer extends SubsystemBase implements SpindexerIO { } if (state == SpindexerState.MAX) { - motor.setControl(new DutyCycleOut(SpindexerConstants.spindexerMaxPower).withEnableFOC(true)); + motor.setControl(new VoltageOut(12 * SpindexerConstants.spindexerMaxPower).withEnableFOC(true)); reversing = false; } else if (state == SpindexerState.REVERSE) { - motor.setControl(new DutyCycleOut(SpindexerConstants.spindexerReversePower).withEnableFOC(true)); + motor.setControl(new VoltageOut(12 * SpindexerConstants.spindexerReversePower).withEnableFOC(true)); reversing = true; } else if (state == SpindexerState.STOPPED) { - motor.setControl(new DutyCycleOut(0.0).withEnableFOC(true)); + motor.setControl(new VoltageOut(12 * 0.0).withEnableFOC(true)); reversing = false; } else if (state == SpindexerState.RESET && resetPos != null) { - motor.setControl(new DutyCycleOut(resetPID.calculate((motor.getPosition().getValueAsDouble() / gearRatio) % 1.0, resetPos)).withEnableFOC(true)); + motor.setControl(new VoltageOut(12 * resetPID.calculate((motor.getPosition().getValueAsDouble() / gearRatio) % 1.0, resetPos)).withEnableFOC(true)); } else { - motor.setControl(new DutyCycleOut(power).withEnableFOC(true)); + motor.setControl(new VoltageOut(12 * power).withEnableFOC(true)); reversing = false; } -- 2.39.5