mirror of
https://github.com/okalachev/flix.git
synced 2025-07-27 09:39:33 +00:00
Fix getDutyCycle return type to make it possible to increase resolution
This commit is contained in:
parent
c2a9d36d4e
commit
3088ade743
@ -27,7 +27,7 @@ void setupMotors() {
|
||||
Serial.println("Motors initialized");
|
||||
}
|
||||
|
||||
uint8_t getDutyCycle(float value) {
|
||||
int getDutyCycle(float value) {
|
||||
value = constrain(value, 0, 1);
|
||||
float pwm = mapff(value, 0, 1, PWM_MIN, PWM_MAX);
|
||||
float duty = mapff(pwm, 0, 1000000 / PWM_FREQUENCY, 0, (1 << PWM_RESOLUTION) - 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user