Installing Arduino libraries enables you to access many features that you can use for your projects. You get to simplify tasks that would otherwise be very complex. You could, for example, write code from scratch or use the Add-ons available on Arduino to do it for you.
The main advantage is that there are thousands of libraries available depending on your needs. You have the option of built-in or additional libraries that you will need to download for installation.
Most importantly, the website has easy-to-follow instructions. Even for beginners, the IDE library manager simplifies the process further.
In our article, we will show you how to download Arduino library. We will also explore the different options available to make it even easier for you.
Using the Library Manager
If you have Arduino IDE version 1.6.2 and above; you have access to the library manager:
Go to Sketch > include library > manage libraries.
Arduino IDE has standard libraries that provide a wide range of functionalities. You can also use hardware such as servo motors with them. The libraries are pre-installed, meaning quick and easy access for you.
What makes the library manager especially useful is the one-click installation. It also contains some of the most popular libraries, such as Adafruits. Before exploring any other option, you should always check out the library manager to see if it has what you need.
Enter your search query based on keywords or products. The library manager will give you options, and once you get the one you want, simply click on the install button.
You will be able to monitor the download process on the progress bar. The faster your internet speed, the faster the download and vice versa.
When the download is complete, it is important to add a header.
Open IDE window > Sketch > include library > Arduino Uno WiFi Dev Ed Library
You also have the option of adding your library to the library manager. You will, however, need hosting on one of the major hosting websites, such as Bitbucket, Gitlab, or Github. If you are on another hosting platform, you have to send in a request to Arduino first.
Manual Installation of a Library
If you don’t have the option of the library manager, you can do a manual installation. Here is what you need to do:
- Download the zip file from the library page
- Open the downloaded file
- If on the Windows platform, you will find the libraries in the ‘My Documents folder’
- Copy the downloaded folder and move it to the libraries folder.
You may need to rename it to remove any hyphen or symbol.
If you are using Mac OS, follow the same steps above. You need to find the downloaded files so that you add them to the Arduino library folder. You have two options:
- Right-click on your docks> options> show in finder
- Go to Finder > applications folder > right click on Arduino app> show package contents>resources> java > libraries folder >Search for the folder you downloaded from the list.
If you are using Linux, the Arduino library will bear the name sketchbook. You will find it in /home/. Any libraries you install, you go straight to the library’s folder in the sketchbook folder. If you are using the earlier versions of Linux, you will need to create the libraries folder. In the later versions, it occurs automatically.
When you install a library, you must restart Arduino.
When you open a zip folder, you will see different types of files in it. Such include a .h, and .txt file, among others. Import the .zip library before you unzip any files.
Follow the steps below.
Open Arduino IDE > Sketch > include library > add .zip library.
You will get a notification to select the library you want to add at this stage.
Open the .zip file > go back to Arduino > sketch > import library
You will find your zip file in the Arduino Sketch directory.
Installing a Library from GitHub
GitHub is a hosting platform where you will find libraries that you can use on Arduino. You must have Arduino 1.5 and above. Transferring your preferred library to Arduino IDE is as simple as:
Log into GitHub > project page > download zip
With the steps above, you will have access to the latest versions.
You will need to rename the zip folder because characters such as hyphens and other symbols are not acceptable. You can only use numbers and letters.
To install the library:
Open Arduino > Sketch > import Library > add library
Restart the library after installation.
Note The Following When Downloading Libraries.
Pay attention to the folders you use. Arduino only finds files in the sketchbook libraries or my documents if you are using Windows. If you move the library folder into a subfolder, the IDE will not locate it.
You should also make sure that you install the library in its entirety. Do not alter or omit any file within the folder.
You can only rename the files to eliminate the illegal characters once you have unzipped the folders.
In some instances, you may need to download additional software or hardware to access some libraries. GFX library, for example, requires specific drivers if you want to use the Adafruit displays.
It is important not to have multiple versions of the same library. Multiple files should be outside of the sketchbook library. If not, Arduino will try to load all the folders resulting in errors.
As mentioned earlier on, installing Arduino libraries gives you access to many features that you can use for your projects. You manage to simplify tasks that would otherwise turn out very complex.
We have looked at easy steps to follow when downloading an Arduino library. Ensure your internet connection is stable with fast speeds. You then have the option of using the library manager, which is the safest and easiest.
Arduino has a rich pre-installed library, which you should explore before importing files from other places. However, the easy to use installation allows you to import zip files or use manual installation.
Whichever method you choose will give you access to tons of features you can use for your projects.