From e3873c99c5bed9db66cfb321192dd90e9f5f6397 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Thu, 9 Jan 2025 11:02:21 +0300 Subject: [PATCH] Fix getDutyCycle return type to make it possible to increase resolution --- flix/motors.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flix/motors.ino b/flix/motors.ino index a0f7d6b..a5c4222 100644 --- a/flix/motors.ino +++ b/flix/motors.ino @@ -26,7 +26,7 @@ void setupMotors() { Serial.println("Motors initialized"); } -uint8_t getDutyCycle(float value) { +int getDutyCycle(float value) { value = constrain(value, 0, 1); float duty = mapff(value, 0, 1, 0, (1 << PWM_RESOLUTION) - 1); return round(duty);