Closed WuSiYu closed 3 months ago
hi and thanks for your contribution :+1:
Please use the develop
branch both as source and target in your PR. The master branch is only for releases.
:warning: although this PR will fix PWM with Arduino 3.x.x, it will break all previous versions.
Please use the LEDC_USE_IDF_V5
macro to prevent this (see line 52):
#if defined LEDC_USE_IDF_V5 // Arduino 3.x.x
ledcWrite(_cfg.pin_bl, duty);
#else
ledcWrite(_cfg.pwm_channel, duty);
#endif
my mistake,I noticed the macro but forgot to add it in the PR branch. I will close this and re-open a PR with the corrected branch and code.
With arduino-esp32 v3.0, in the new ledcWrite() API we should use the GPIO pin number instead of pwm channel number (ref).