Arduino IDE don't recognize the ESP32Servo.h library

I try to use a Servo motor with Arduino NANO ESP32, but already the IDE has stuck me.
I downloaded the ESP32Servo library, and tried to run the code, and get this error message:

"Compilation error: 'ESP32Servo' does not name a type; did you mean 'ESP32_Servo_h'?"

The Code:

#include <ESP32Servo.h>

ESP32Servo myServo; 

void setup() {

}

void loop() {

}

The interesting thing is that the following code run correctly:

#include <ESP32Servo.h>

void setup() {

}

void loop() {


}

I have tried to install a previous version of the library and tried to reinstall the arduino IDE.

Screenshot 2024-10-03 065839

I have no idea what is wrong.

Have you looked at the examples that come with the library ?

ESP32Servo myServo;

should be

Servo myServo;
1 Like

Please edit your post, select all code and click the <CODE/> button. Next save your post.

This will apply code tags as described in How to get the best out of this forum (please read it again) which makes the code easier to read and copy and the forum software will display it correctly.

Ohh... I feel like a fool. You right, now already working the code.

Indeed I did not read the rules, I have corrected my post, thank you for your comment.

1 Like