We all love Arduino. It is customizable, easy to use and affordable. But when you are playing around with Arduino’s modules, you might run into difficulties when installing the necessary libraries. Or perhaps when you’re following a tutorial on Instructables, and you didn’t know how to install the Arduino library. Here are some common errors that you might see when an Arduino library is missing or not installed 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 who already know what is a library, you can skip to the Instruction on Installing an Arduino library.
What is a library?
Every Arduino module requires a specific library. A library are a file that contains 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 to help you better understand the module.
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 an Arduino Library.
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 who are working on ultrasonic sensor modules, 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 watching this tutorial aren’t working on an ultrasonic sensor module, so please go to your original tutorial website and search for the download link to of library.
If you can’t find the download link, just 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 has been open the entire 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.
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.
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, please leave a comment below and I will reply to it. That’s it for now, if you liked this tutorial, perhaps you might like some of the others. Check them out at www.cytron.com.my