Skip to content

Commit 486422c

Browse files
committed
Fix build error
1 parent ab82347 commit 486422c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/ledc/ws_ledc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ bool ws_ledc::analogWrite(uint8_t pin, int value) {
5555
// Calculate duty cycle for the `value` passed in
5656
// (assumes 12-bit resolution, 2^12)
5757
//uint32_t dutyCycle = (4095 / 255) * min(value, 255);
58-
uint32_t dutyCycle =(uint32_t)(((double)12 / 255.0) * min(value, (uint32_t)255));
58+
uint32_t dutyCycle =(uint32_t)(((double)4095 / 255.0) * min((uint32_t)value, (uint32_t)255));
5959

6060
// Call duty cycle write
6161
return setDuty(pin, dutyCycle);

0 commit comments

Comments
 (0)