'ledcSetup' was not declared in this scope
- ESP32 core 3.x
You may see
Why it happens
- The code was written for ESP32 core 2.x and you have 3.x, where
ledcSetupandledcAttachPinwere removed.
How to fix it
- Change
ledcSetup(channel, freq, bits);andledcAttachPin(pin, channel);to one line:ledcAttach(pin, freq, bits);. - Change
ledcWrite(channel, value)toledcWrite(pin, value). - Or install ESP32 core 2.0.17 in the Boards Manager and keep the code as it is.
It worked if: Verify passes and the LED fades.
Related errors
Seen in a real run (some lines are close variants of it). Produced with Arduino CLI 1.5.1 and ESP32 core 3.1.3. Sources: Arduino ESP32: moving from 2.x to 3.0.
Didn't help? Search another error or ask us.

