Go Down

Topic: External Libraries (Read 3241 times) previous topic - next topic



Does anyone know how do i use an external library that are not yet available for installation via the Arduino Library Manager ?

Ubuntu 20.04


Somebody gave me the answer:

I just have to put the library file next to the .ino file


Hi @anhellon. Although it is possible to put libraries in the sketch folder and useful sometimes, you'll find that some libraries will need modification due the the library author having used the #include <Foo.h> syntax instead of the correct #include "Foo.h" for including local files. Either one works when the library is correctly installed, so many library authors just use either syntax randomly.

It also sort of goes against the whole idea of libraries, which are a way to share the same code between multiple program.

The more standard approach is to install the library under the libraries subfolder of the user directory. This is what arduino-cli lib install does. The user directory location is shown under the directories.user key of the arduino-cli config dump output.

Go Up