mirror of
https://github.com/okalachev/flix.git
synced 2025-07-29 20:38:59 +00:00
Fix getDutyCycle return type to make it possible to increase resolution
This commit is contained in:
parent
fd437b96d3
commit
e3873c99c5
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user