Installing Arduino Library

We all love Arduino. It is can be customized, it’s easy to use and it’s cheap. But when you are playing around with modules that are compatible with arduino, you might run into difficulties when installing the library for it. Or perhaps when you’re following a tutorial on instructable website, you didn’t know how to install the arduino library. Here are the errors that you would see when you didn’t install an arduino library or didn’t install it properly.Error

The most common error that you would see at the bottom is  ” ‘Your library’ does not name a type”. So today we are going to learn the proper steps to install an arduino library.
If you are not sure what are libraries, I will explain now. For those whom already know about library, you can skip to the Instruction on Installing arduino library.

What is a library?

Every Arduino modules require a specific library. Library are a file that contain all the necessary programming required for your module to run. It basically simplifies your programming and make your life easier. A library folder also contain an example file which consist of an example sketch that can be opened and uploaded to your arduino.
In many cases, people whom followed tutorial on the internet just copy the sketch available and paste it in their sketch. If the sketch require a specific library, this would lead to the error that I’ve shown just now.

Example

Instructions on Installing arduino library.

Alright, let’s start installing libraries.

 

Identify the link to download the library.

I would demonstrate this with the NewPing library. NewPing is used for the ultrasonic sensor module. For those whom are working on ultrasonic sensor module, just click on this link to download the ultrasonic sensor library.
https://bitbucket.org/teckel12/arduino-new-ping/downloads/NewPing_v1.7.zip
The moment you click the link, it will straight away download a file named “NewPing-v1.7” for you.
Now, I am pretty sure most of you whom are watching this tutorial aren’t working on ultrasonic sensor module , so go back to your original tutorial website and search for the download link to your library.
If you can’t find the download link, just go to google and type in “Arduino ultrasonic sensor library” or “Arduino GPS library” or whatever you are looking for.

Open up the folder.

In my case, when I open the NewPing-v1.7, there is another folder named NewPing, so I open it up and found this.
Example
When you see a CPP file and a Hex file, that means you have downloaded the right stuff.

Extract the folder.

Now go one step backwards. You should see the “Extract all” option available. Click it and extract the folder.
After that, another window will pop up and you might notice that the “Extract all” option is gone.Extract NewPing

Copy the folder into arduino library folder.

This is the most important step. First, copy the folder. In my case, it is the NewPing folder. Then, navigate to your arduino main folder. For me, it is like this : OS(C:) > Program Files (x86) > Arduino  > libraries . And then, paste it into the folder.
copy paste

Restart your IDE.

If your arduino IDE are opened the whole time. Close it and open it again.

Enjoy the feeling of success!

Now that you are done installing your library. Your should be able to compile your sketch without any problem.

Success

Video

If you are feeling lazy or frustrated to read through all the instructions. You can watch my short video on installing arduino library. This video shows me installing the NewPing library.

Lesson

Alright, so now you know how to install arduino library into your computer. By doing so, you can complete your arduino projects with ease. I hope this tutorial help you.  If it doesn’t , leave a comment below and I will reply you. That’s it for now, if you like this tutorial, perhaps you might like some of the others. Check them out at www.cytron.com.my

,

Related Post

Getting Started with Colour Sensor Module (SN-COLOUR-MOD)

Getting Started with Tilt Sensor (SN-TILT)

Getting Started with Vibration Sensor Module (Normally Off) (SN-VIBRATE-MOD)

Getting Started with IR Distance Click

Leave a Reply

Your email address will not be published. Required fields are marked *