Minor fixes

This commit is contained in:
Oleg Kalachev
2024-12-25 01:41:45 +03:00
parent fd30027ea4
commit 2efae82177
3 changed files with 3 additions and 5 deletions

View File

@@ -26,8 +26,8 @@ void setupMotors() {
Serial.println("Motors initialized");
}
uint8_t signalToDutyCycle(float control) {
float duty = mapff(control, 0, 1, 0, (1 << PWM_RESOLUTION) - 1);
uint8_t signalToDutyCycle(float signal) {
float duty = mapff(signal, 0, 1, 0, (1 << PWM_RESOLUTION) - 1);
return round(constrain(duty, 0, (1 << PWM_RESOLUTION) - 1));
}