The great thing about the concept behind the Arduinos is that in many cases you can benefit from the work of others.
It does not matter which sensor you read or which actuator you want to drive: This has certainly someone else done before you. Most of the time, these people have written libraries that make it easier for you to work with the sensors/actuators. Often these libraries were then published as an open source project.
So it happens that you can actually find libraries for almost any hardware that you can connect to the Arduino.
These then only have to be integrated into the ArduinoIDE and you’re ready to go.
How to add libraries in ArduinoIDE is explained in the following article.
Hints for our lovely english readers: Basically, many of the articles on Nerdiy.de are translations from the original german articles. Therefore, it may happen here and there that some illustrations are not available in english and that some translations are weird/strange/full of mistakes or generally totaly wrong. So if you find some obvious (or also not obvious) mistakes don't hesitate to leave us a hint about that in the comment section.
Also please don't get confused, that instead of a "dot" often a "comma" is used as decimal separator. 🙂
I know the following hints are always a bit annoying and seem unnecessary. But unfortunately, many people who knew it "better" from carelessness lost their eyes, fingers or other things or hurt themselves. In comparison, a loss of data is almost not worth mentioning, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Even the coolest project is worth no injury or other annoyance. https://www.nerdiy.de/en/sicherheitshinweise/
The links to online shops listed here are so-called affiliate links. If you click on such an affiliate link and shop via this link, Nerdiy.de receives a commission from the online shop or provider concerned. The price doesn't change for you. If you do your purchases via these links, you will support Nerdiy.de in being able to offer further useful projects in the future. 🙂
Before you start, you should have downloaded and installed the ArduinoIDE.
How to do that I described in the following article:
Downloads / Uploads – How the data comes from the internet and disappears again
Install programs – an example
Basics of navigation in Windows Explorer
General tips for the ArduinoIDE can be found in the article ArduinoIDE – Tips and Tricks
Automatic installation via the ArduinoIDE
The automatic installation of a library is the easy way to install an Arduino library. Unfortunately, this is not possible with all libraries. Nevertheless, it is easiest to always check the automatic installation option first. If the library is not found, you can still install it manually. More on that later.
For automatic installation, you have to switch to the ArduinoIDE.
To install a click on “Install” and the selected library will get installed.
Manual installation via Windows Explorer
The manual installation of a library is always necessary if the library was not found during the automatic installation. Even if you want to install several libraries, it is often easier / faster to install them “in one go” as this is done with a simple copy operation.
No matter where the library comes from before it can be installed, you must first download it to your computer.
As an example, the Adafruit Neopixel library will be installed here.
You can find them at https://github.com/adafruit/Adafruit_NeoPixel
Download the entire contents of the GitHub directory. How to do this is explained in the article GitHub – How to copy files from a github to my computer.
Then unzip the downloaded zip file (the GitHub directory) to a location of your choice.
Information about unpacking an archive can be found in the article WinRar? WinZip? WinWhat? – Darling I shrunk the files
After that you have to restart the ArduinoIDE – if it is already running. This loads the new libraries and displays any existing examples in the ArduinoIDE. You should then be able to use the libraries.
If necessary, think about including the respective library like
in your Arduino project. Only then can you really use the functions of the new library.
I hope everything worked as described. If not or you have any other questions or suggestions, please let me know in the comments. Also, ideas for new projects are always welcome. 🙂
P.S. Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you appreciate it that I share these information with you, I would be happy about a small donation to the coffee box. 🙂