-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PWM ledCWrite(255) or ledcWrite(1023) is not 100% on #5089
Comments
esp32 does not have a fixed bit width like atmel and esp8266 boards, so max is pow(2,bit_res). You have not included your ledcSetup call, so your issue is not clear. |
Yeah sorry about that, what I mean is that the bug is there if I call
So 8 bits max value 255 does not light off the Led, 10bits max value 1023 does not light off led, I need to set to max value + 1 to get it working. |
255 is max light and 0 is off |
yeah that is the issue (255) is not full 100% HIGH level, if you connect the LED as follow (3V3 not 5V of course) You won't be able to light off the LED because 255 is not fully 100% Detailled explanation, same issue than this one Of course if you connect the LED other side your eye is unable to see light difference to full light and missing 1/255 pulse. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Hardware:
Board: ESP32
Description:
Unable to light off PWM common anode RGB Led when setting value to latest value of range.
Old known issue of ESP8266 #5957 and now seen is Tasmota and my sample test program
The fix is described in comments of official sample code
But from logical working, having value going from 0 to 255 should means that 255 is full scale so always 1 and not having a little pulse. This does now works on ESP8266 with analogWrite(255) and comments have been updated to code according in this PR
I know it's not arduino but I think if PWM could work as is
0 (always off) and max range value (always on)
would be less confusingmy
ledOff()
sample function with 256 does works, but should works with 255, much easier if we use anuint8_t
as scale range.The text was updated successfully, but these errors were encountered: