Dlloydev / ESP32-ESP32S2-AnalogWrite

ESP32 PWM, Servo, Easing and Tone. Smart GPIO pin management and advanced control features.
MIT License
100 stars 17 forks source link

Can't compile for ESP32 DEV Board #24

Closed jenshackel closed 1 year ago

jenshackel commented 1 year ago

Hi. I've got trouble for compiling when using any other esp32 board instead of esp32s2.

I tried different versions of the library as well as arduino 2.03 / 1.18.19 and Visual Studio Code as well. I also used different versions of ESP32 lib (1.5.0, up to the latest 2.x) All are producing the same failure message:

T:\users\L\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp: In member function 'uint8_t Pwm::tone(uint8_t, uint32_t, uint16_t, uint16_t)': T:\users\L\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:91:65: error: 'ledcChangeFrequency' was not declared in this scope ledcChangeFrequency(ch, frequency, config[ch].resolution); ^ T:\users\L\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp: In member function 'void Pwm::ledc_attach_with_invert(uint8_t, uint8_t, bool)': T:\users\L\Documents\Arduino\libraries\ESP32_ESP32S2_AnalogWrite\src\pwmWrite.cpp:319:3: error: 'ledc_channel_config_t' has no non-static data member named 'flags' }; ^ exit status 1 Fehler beim Kompilieren für das Board ESP32 Dev Module.

It's getting really frustrating an I hope you've got a clue for me. CHEERS! Jens.

Dlloydev commented 1 year ago

Actually, the latest required versions are:

The error message you've shown occurs for older versions of the ESP32 Arduino.

Good luck! David.

jenshackel commented 1 year ago

Hi David, Thanks for the fast reply. I'm going to test it in the evening and give a report later. Are you using IDE 2.0.x or 1.18?

Dlloydev commented 1 year ago

I have both Arduino 1.8.19 and Arduino 2.0.3 on my PC. It works with both, however I suggest starting with Arduino 1.8.19

Should be able to get ESP32 Arduino using Boards Manager... image

and this library using Manage Libraries... image

jenshackel commented 1 year ago

It can be so simple! Just uninstalled and re-installed IDE V1.8.19 and Lib V4.2.4 ... works instantly! Nevertheless thank you very much for the exellent support. Now I can move on with my project and your fine library (exactly what I needed!) best regards Jens