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.
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.
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.
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.
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.
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.
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.