Installing a new Arduino library is a straightforward process. Basically, you have to follow these steps:
- Locate the path where the Arduino application directory (APPDIR) is
- Copy the new library into a new folder of APPDIR/libraries
- Restart the Arduino IDE
The first point depends on the operating system you’re using.
In Linux/MacOs, if you do not know the APPDIR, use the following commands:
This will locate the command “arduino”. It may return “/usr/bin/arduino”.
Once known the path of the arduino script, use:
cat /usr/bin/arduino | grep APPDIR
The command will report you the APPDIR needed.
In Windows, right click on the link to the Arduino IDE executable and select “properties”. From the window, you’ll able to find the directory where the Arduino IDE is stored, that is the same as the application dir.
Before coping the library files (by using sudo cp in Linux), take a look on the “libraries” folder’s structure. Note that every library must be placed inside a different directory. Indeed, the name of the source files (the .cpp and .h files) has to be equal to folder’s name.