Skip to content

Conversation

@IsmaCortGtz
Copy link

I added support for the new ESP32 API. There were some breaking changes with the LEDC API.

I implemented the @The39thBit suggestion in #16 and replaced ledcWrite (that now only works with a PIN number) for ledcWriteChannel.

Additionally, it would be nice to add a note informing people about this breaking change.

@dzalf
Copy link

dzalf commented Apr 24, 2025

I just want to confirm that these changes will bring the library back to life (gracias @IsmaCortGtz! Salud, chingao 🍺)

@wilmouths, are you still maintaining this repo?

Cheers
🍻

@wilmouths
Copy link
Owner

I have to test the changes, I'm not very present on this repository at the moment.

I'll take care of it soon

@fr-fhe
Copy link

fr-fhe commented Aug 19, 2025

Hi all,

Tested this commit on ESP32-S2, and it doesn't work (no action at all on an rgb led).
But removing ESP32 code and using analogWrite() works...

S2 specific ?

Please note some things about your commit :
1/ cosmetic bug ? => ledcAttachChanel on blue is parametred at a 50Khz freq when R+G are at 5Khz freq. Please harmonize.
2/ according to espressif (https://docs.espressif.com/projects/arduino-esp32/en/latest/api/ledc.html), you must initialize LEDC system with ledcSetClockSource

I note that LEDC pins are hard coded (0,1,2), making unable to use another RGB Led object.
But after deeper analyse, problem is core library based... no pin allocator, in fact...
(in my case, i want to use 3 RGB Led on my S2, so ... boom)

analogWrite() solution (cf. brendanm250) seems to be the best option for now...

Just my penny :)

Take care.

H.F.

@wilmouths
Copy link
Owner

I got myself an ESP32. I'm going to test this PR this weekend and see what needs to be done to make it compatible with an ESP32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants