How To Get and To Install A New Library on Arduino IDE



robotics-university.com | Hello friends, today I will make a guidance how to install new library on Arduino IDE. If you a newbie on using Arduino board and Arduino IDE software, its better if you read this article completely. Read this article and practiced by follow the guidance, hopefully this article useful for you. 

Friends, when We build an embedded systems application using Arduino IDE, sometime We need one or two additional libraries to make us easier when create its program/sketch. But there are no libraries that we need on Arduino IDE. If we face this condition, what should we do? 

Yeah … You are right! We have to hunt that library by ourselves on the internet using search engine. 

For example, on an embedded systems project, we need: 
1. DHT22 temperature & humidity sensor library. 
2. DC motor servo (VarSpeedServo) library. 

Follow the steps below, in order you can install it on the Arduino IDE. 

STEP 1: Search & Download the Library That We Need on the Internet 
In this case, I assume that you haven’t been has Arduino library for DHT22 sensor and DC motor servo. So, for the first step, you have to search that library on the internet. Open your internet browser, then choose one search engine. To search DHT22 sensor library, type keywords “dht22 arduino library” in the search box, then press Enter on your keyboard (See figure 1). 

Figure 1. Search DHT22 library for Arduino 

Click one of the page-link that available to open the repository page (See figure 1). After the repository has been opened, click green “Code” button, then click “Download ZIP” file option (See figure 2). Save the ZIP file on a directory/folder in your computer hardisk. 

Figure 2. Download DHT22 library from Adafruit repository on Github 

Next, to search VarSpeedServo library, type keywords “VarSpeedServo arduino library” in the search box, then press Enter on your keyboard (See figure 3). 

Figure 3. Search VarSpeedServo library for Arduino 

Then with the same method, download the VarSpeedServo library from netlabtoolkit repository on Github (See figure 4). 

Figure 4. Download VarSpeedServo library from netlabtoolkit repository on Github 

STEP 2: Add the Library on the Arduino IDE 
In order the DHT22 and VarSpeedServo library can be available on Arduino IDE, you have to add it with following the steps below. At the first, open Arduino IDE, then select “Sketch” menu on the menu-bar, then choose “Include Library” and “Add .ZIP Library …” option (See figure 5). 

Figure 5. Add a library ZIP file on the Arduino IDE 

Figure 6. Open the ZIP file of DHT22 library 

Figure 7. The indicator that a ZIP file has added on Arduino IDE 

Do the same steps to add VarSpeedServo library ZIP file on the Arduino IDE. 

STEP 3: Use the New Library on Your Program/Sketch 
To use a library that has available/added on Arduino IDE, first, place your cursor to the top of your program/sketch (See figure 8). 

Figure 8. Cursor placement when add a library into a program-sketch 

Figure 9. Step to add DHT22 sensor library into a program/sketch 

Figure 10. DHT22 sensor library has added into a program/sketch 

Do the same steps to use VarSpeedServo library into your program/sketch. 

Share on Google Plus

About Taufiq D.S. Suyadhi

    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment