ESP32 ledcsetup was not declared on this scope

I got this error everytime i complie and verify. im using a ESP32 Board. IM noob on this. thank you

C:\Users\RJ\Downloads\R2D2_CLOCK_AND_TIMER-main\R2D2_CLOCK_AND_TIMER-main\R2D2_clock_timer_v5_HARD_CODED_CREDENTIAL\R2D2_clock_timer_v5_HARD_CODED_CREDENTIAL.ino: In function ‘void setup()’:
C:\Users\RJ\Downloads\R2D2_CLOCK_AND_TIMER-main\R2D2_CLOCK_AND_TIMER-main\R2D2_clock_timer_v5_HARD_CODED_CREDENTIAL\R2D2_clock_timer_v5_HARD_CODED_CREDENTIAL.ino:60:3: error: ‘ledcSetup’ was not declared in this scope
60 | ledcSetup(0, 5000, 8);
| ^~~~~~~~~
C:\Users\RJ\Downloads\R2D2_CLOCK_AND_TIMER-main\R2D2_CLOCK_AND_TIMER-main\R2D2_clock_timer_v5_HARD_CODED_CREDENTIAL\R2D2_clock_timer_v5_HARD_CODED_CREDENTIAL.ino:62:3: error: ‘ledcAttachPin’ was not declared in this scope; did you mean ‘ledcAttach’?
62 | ledcAttachPin(RED_LED, 0);
| ^~~~~~~~~~~~~
| ledcAttach

exit status 1

Compilation error: ‘ledcSetup’ was not declared in this scope

…Are you even using PlatformIO?

In any case, ledSetup() was present in Arduino-ESP32 2.x and was removed in 3.x, just like

https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides/2.x_to_3.0.html

says. So, just go into the Arduino IDE’s board manager → esp32 → pick version “2.0.17” and press update.