]> git.taranathan.com Git - FRC2026.git/commitdiff
better stuff
authormoo <moogoesmeow123@gmail.com>
Fri, 17 Apr 2026 21:56:15 +0000 (14:56 -0700)
committermoo <moogoesmeow123@gmail.com>
Fri, 17 Apr 2026 21:56:15 +0000 (14:56 -0700)
src/main/java/frc/robot/subsystems/spindexer/Spindexer.java

index e9cb913d10c9ece92e084a7c97040ffd93f90231..f195e2c9f49688909e1e565862e6e0b8292ead8a 100644 (file)
@@ -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;
         }