Evening, have done a lot of research and have tried several ideas mentioned here and everywhere else but can't find a solution.
I am trying to run a servo on an Arduino Nano ESP32. The standard arduino servo library is not compatible, and the ESP32Servo library is throwing me errors (with only the #include).
Has anyone been able to get the Nano ESP32 to drive servos?
I keep getting the following error.
Documents\Arduino\libraries\ESP32Servo\src\ESP32PWM.cpp: In member function 'void ESP32PWM::attachPin(uint8_t)':
Documents\Arduino\libraries\ESP32Servo\src\ESP32PWM.cpp:312:42: error: void value not ignored as it ought to be
success=ledcAttachPin(pin, getChannel());
Currently using:
Arduino ESP32 boards 2.0.13
ESP32Servo 3.0.4
Hi @ridilen. This bug has been reported to the library author:
A fix is already in progress. Until that fix is released, the best workaround will be to install the older version of the library from before the bug was introduced in version 3.0.4. I'll provide instructions you can follow to do that:
Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus to open the "Library Manager" view in the left side panel.
Type ESP32Servo in the "Filter your search..." field.
Scroll down through the list of libraries until you see the "ESP32Servo" entry.
You will see a drop-down version menu at the bottom of the entry. Select "3.0.3" from the menu.
Click the "INSTALL" button at the bottom of the entry.
Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:
ⓘ Successfully installed library ...
Arduino IDE will periodically display a notification that offers to update the library for you:
Updates are available for some of your libraries.
If you click the "INSTALL MANUALLY" button in the notification, a list of each of the libraries that have available updates will be shown in the Arduino IDE Library Manager. It is generally a good idea to keep your libraries updated since the updates might provide important enhancements or bug fixes. So you should look through the list and update other libraries if appropriate, but you should avoid accepting the update for the "ESP32Servo" library until the next release comes out with the fix.