We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab82347 commit 486422cCopy full SHA for 486422c
src/components/ledc/ws_ledc.cpp
@@ -55,7 +55,7 @@ bool ws_ledc::analogWrite(uint8_t pin, int value) {
55
// Calculate duty cycle for the `value` passed in
56
// (assumes 12-bit resolution, 2^12)
57
//uint32_t dutyCycle = (4095 / 255) * min(value, 255);
58
- uint32_t dutyCycle =(uint32_t)(((double)12 / 255.0) * min(value, (uint32_t)255));
+ uint32_t dutyCycle =(uint32_t)(((double)4095 / 255.0) * min((uint32_t)value, (uint32_t)255));
59
60
// Call duty cycle write
61
return setDuty(pin, dutyCycle);
0 commit comments