How to Add an External Library to Arduino

8.0K12

Intro: How to Add an External Library to Arduino

The library provides additional functions for the sketch we made. These functions can help us make sketches easier.

There are many libraries that we can use. Arduino IDE's default library or external library created by someone or a community.

In this article I will show you how to add an external library.

STEP 1: Add Libraries Using Arduino IDE

You can add libraries directly using the Arduino IDE.

1. Click Sketch > Include Library > Manage libraries ( You can use the shortcut Ctrl + Shift + l )

2. Write library in the search tab.

3. Click install and wait until the process is complete

4. When it's finished, it will say "INSTALLED" in the title

STEP 2: Add Library Using Zip File

You can search for external libraries on the Internet. Many websites provide external libraries in the form of Zip. I suggest looking for Libray on Github, because there are many people or communities that share libraries that they create.

How to add a zip file:

1. Click Sketch > Include Library > Add .Zip Library.

2. Select the zip file that has been downloaded, Then Click Open.

3. After successfully adding, close the Arduino IDE then reopen it

STEP 3: Check Libraries That Have Been Added

1. Click Sketch > Include Library > scroll down

2. Look in the contributed library.

3. Successfully added libraries can be seen here.

thank you for reading, see you in the next article

Comments

Noob here. Re libraries. For example, I used a library for the DS3231 that came with its DS3231_Serial_Easy sketch. When I use another sketch that calls for its own DS3231 library, the previous one will not work. So, I erase the old one and upload the new one, and the new sketch works. But when I compile the previous DS3231_Serial_Easy sketch, this new one does not work, so again, I delete the new DS3231 library and re-upload the old one so it works again. Is there a better way to do this so that they agree to stay in the same Arduino library and work for their respective sketches without the bothersome delete-reupload routine? Thanks to whoever answers this.