ESP32 PWM code once worked but with no modifications now it doesn't

If I need to provide more information please let me know.

The issue I'm having is in order to confirm the version of a sketch I was working on I reuploaded it without any modifications and now I'm getting a compile error on the function "ledcAttachPin()".

I'm positive this code used to work, it controlled my motor great, worked as expected.

I tried everything chatGPT suggested but no luck.

Most of the code in this gist is irrelevant but the problem is on line 166, I left some notes. sketch_feb27a.ino · GitHub

Any help would be greatly appreciated! I'm just out of ideas.

you could be having problems with the upgrade from ESP32 core 2.0.x to 3.0

to check installed version select Tools>Board then Board manager enter esp32 look under esp32 by Espressif, e.g. this shows that 3.0.1 is installed

if you have V3 installed try going back to V2?

You're exactly right! That fixed it.

I downgraded to 2.0.17 and all I had to do was then change ledcAttach() to ledcSetup()

Thanks for your help!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.