Libraries are a collection of code that provide extra functionality for use in sketches, for example when working with hardware or manipulating data. Learn how to add libraries to Arduino IDE.
In this article:
Using the Library Manager
-
Do one of the following:
- In the menu bar, select Tools > Manage Libraries…
- In the sidebar, click on the button.
-
Filter the available libraries by typing something (such as a library name) in the text field above the listed libraries.
-
Find the library in the search results. The results are listed alphabetically, so you may need to scroll down the list.
-
Find a library you want to install. You can review the description and author. When you’ve found a library you want to install, click Install. The latest version is selected by default.
-
Wait for the installation to complete.
Note
To find more information about the library, click More info. This will usually take you to a reference page or repository for the library
Importing a .zip library
-
In the menu bar, go to Sketch > Include Library > Add .ZIP Library…
-
You will be prompted to select the library you want to add. Navigate to the .zip file’s location and open it.
Manual installation
-
Go to the directory where you have downloaded the .zip library file.
-
Extract the .zip file.
-
Select the main folder (it should have the library’s name) and move it to the “libraries” folder inside your sketchbook.
-
Restart Arduino IDE.
Note
Adding a library to the “libraries” folder in the sketchbook will override other previously installed library versions.
Using installed libraries
When the library has been installed you can do the following:
-
Open any included example sketches from File > Examples > <Library Name> in the top menu bar.
Note
Some libraries don’t come with examples.
-
Include the library in your sketch by selecting Sketch > Include Library > <Library Name>.
Further reading
-
Installing libraries in the Arduino IDE on Arduino Docs
-
About #include