remrc / Self-Balancing-Cube

271 stars 62 forks source link

Compilation error: 'ledcSetup' was not declared in this scope #12

Open jcleek opened 2 weeks ago

jcleek commented 2 weeks ago

I am trying to upgrade my cube from your first version and getting an error when I try to upload to the ESP32. I have made it through most of the issues I encountered but this one I am unable to resolve so hoping you can point me in the right direction.

My search led me to an upgrade thread for arduino ESP32 for migration from 2.0 - 3.0 that aligns with the timeline for your code release date so maybe that's it. I just don't know how to resolve it.  

C:\Downloads\Self-Balancing-Cube-main\esp32_cube_enc\esp32_cube_enc.ino: In function 'void setup()':
C:\Downloads\Self-Balancing-Cube-main\esp32_cube_enc\esp32_cube_enc.ino:55:3: error: 'ledcSetup' was not declared in this scope
   55 |   ledcSetup(PWM1_CH, BASE_FREQ, TIMER_BIT);
      |   ^~~~~~~~~
C:\Downloads\Self-Balancing-Cube-main\esp32_cube_enc\esp32_cube_enc.ino:56:3: error: 'ledcAttachPin' was not declared in this scope; did you mean 'ledcAttach'?
   56 |   ledcAttachPin(PWM1, PWM1_CH);
      |   ^~~~~~~~~~~~~
      |   ledcAttach

exit status 1

Compilation error: 'ledcSetup' was not declared in this scope
remrc commented 2 weeks ago

Yes, use ESP32 2.*.