}
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;
}