[SOLVED] Servo.h : not such file or directory

I'm trying to compile a simple sketch to control a micro servo but I get the following error in compilation time

/home/rodrunner/Arduino/sketch_jul03a/sketch_jul03a.ino:1:19: fatal error: Servo.h: No such file or directory
 #include <Servo.h>
                   ^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.

The sketch was just copied from the arduino samples, my source code begins like this:

#include <Servo.h>

Servo myServo;
int flexSensorPin = 0; //analog pin 0
int flexSensorReading // Value read from analog pin A0

I can't see what is wrong. Maybe I need to change some path in the preferences? I'm using Arduino IDE 1.8.5

1 Like

Ok, I thought I had the library installed, but I didn't. Solved

1 Like

The error is telling you it can't find the Servo library. It comes as part of the IDE. It normally lives under ..\libraries\Servo wherever you installed the IDE (looks like you are on linux or MAC).

On Windows, that is C:\Program Files (86)\Arduino\libraries\Servo

Is it not normally installed automatically with the IDE ?

It wasn't in my case (IDE installed in arch linux)