|
| 1 | +--- |
| 2 | +title: "Add a library to Arduino IDE" |
| 3 | +--- |
| 4 | + |
| 5 | +Libraries are a collection of code that provide extra functionality for use in sketches, for example when working with hardware or manipulating data. |
| 6 | + |
| 7 | +Learn how to add a library to Arduino IDE. |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## Using the Library manager |
| 12 | + |
| 13 | +1. In the menu bar, go to `Tools > Manage Libraries...` (In IDE 2, you can also click on the Library Manager icon on the left). |
| 14 | + |
| 15 | +2. Search for the library you want to install. |
| 16 | + |
| 17 | +3. Find the library in the search results. |
| 18 | + |
| 19 | +4. Click on the INSTALL button. |
| 20 | + |
| 21 | +  |
| 22 | + |
| 23 | +  |
| 24 | + |
| 25 | +5. Wait for the installation to complete. |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +## Importing a .zip Library |
| 30 | + |
| 31 | +1. In the menu bar, go to `Sketch > Include Library > Add .ZIP Library...` |
| 32 | + |
| 33 | +2. You will be prompted to select the library you want to add. Navigate to the .zip file's location and open it. |
| 34 | + |
| 35 | +3. If you're using Arduino IDE 2.x, you may need to restart it for the library to be available[^1]. |
| 36 | + |
| 37 | +[^1]: https://github.com/arduino/arduino-ide/issues/659 |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +## Manual Installation |
| 42 | + |
| 43 | +1. Go to the directory where you have downloaded the .zip library file. |
| 44 | + |
| 45 | +2. Extract the .zip file. |
| 46 | + |
| 47 | +3. Select the main folder (it should have the library's name) and move it to the "libraries" folder [inside your sketchbook](https://support.arduino.cc/hc/en-us/articles/4412950938514-Open-the-Sketchbook). |
| 48 | + |
| 49 | +4. Restart Arduino IDE. |
| 50 | + |
| 51 | +> Note that adding a library to the "libraries" folder in the sketchbook will override other previously installed library versions. |
| 52 | +
|
| 53 | +--- |
| 54 | + |
| 55 | +## Further reading |
| 56 | + |
| 57 | +* [Uninstall a library from Arduino IDE](https://support.arduino.cc/hc/en-us/articles/360016077340-Uninstall-a-library-from-Arduino-IDE) |
| 58 | + |
| 59 | +* [Installing libraries in the Arduino IDE 1](https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries#importing-a-zip-library) on Arduino Docs |
| 60 | + |
| 61 | +* [Installing libraries in the Arduino IDE 2](https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-installing-a-library) on Arduino Docs |
| 62 | + |
| 63 | +* About [#include](https://www.arduino.cc/reference/en/language/structure/further-syntax/include/) |
0 commit comments