Arduino: using libraries

We’re millions of computer programmers, around the world, 95% of the time working on solving more or less the same problems. Thankfully developers realized, long ago, that code can be written to be reused, in the form of libraries. And t…


This content originally appeared on flaviocopes.com and was authored by flaviocopes.com

We’re millions of computer programmers, around the world, 95% of the time working on solving more or less the same problems. Thankfully developers realized, long ago, that code can be written to be reused, in the form of libraries. And those libraries can be shared among developers.

Often libraries are shared free of charge, openly, and this is the case of Arduino.

Some libraries are “Arduino official libraries”, curated by the Arduino team.

The official libraries can be found on this page: https://www.arduino.cc/reference/en/libraries/ and their source code is available on GitHub at https://github.com/arduino-libraries.

Since they are on GitHub, it’s easy to start collaborating on them, too, to submit fixes and improvements.

Official libraries are very easy to include in our project.

In the Arduino IDE Sketch menu, select Include Library, and you will see a list of Arduino libraries included by default.

Pick one, for example Servo:

This will add a #include <Servo.h> line on top of the file, and you’re ready to go.

You can include more libraries through the Library manager, which you can open from the menu Tools and Manage libraries...:

Some libraries are built and maintained by the community, and they do not have a centralized place where they can be found.

Google is a good place where to find those libraries.

Sometimes you need to include a library that’s not official and not included in the Library manager.

In this case in the Arduino IDE Sketch menu, select Include Library, and then choose Add .ZIP library to load a library from a zip file.

After you load it, you will see it listed in the Contributed libraries section in the menu.


This content originally appeared on flaviocopes.com and was authored by flaviocopes.com


Print Share Comment Cite Upload Translate Updates
APA

flaviocopes.com | Sciencx (2021-03-30T05:00:00+00:00) Arduino: using libraries. Retrieved from https://www.scien.cx/2021/03/30/arduino-using-libraries/

MLA
" » Arduino: using libraries." flaviocopes.com | Sciencx - Tuesday March 30, 2021, https://www.scien.cx/2021/03/30/arduino-using-libraries/
HARVARD
flaviocopes.com | Sciencx Tuesday March 30, 2021 » Arduino: using libraries., viewed ,<https://www.scien.cx/2021/03/30/arduino-using-libraries/>
VANCOUVER
flaviocopes.com | Sciencx - » Arduino: using libraries. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/03/30/arduino-using-libraries/
CHICAGO
" » Arduino: using libraries." flaviocopes.com | Sciencx - Accessed . https://www.scien.cx/2021/03/30/arduino-using-libraries/
IEEE
" » Arduino: using libraries." flaviocopes.com | Sciencx [Online]. Available: https://www.scien.cx/2021/03/30/arduino-using-libraries/. [Accessed: ]
rf:citation
» Arduino: using libraries | flaviocopes.com | Sciencx | https://www.scien.cx/2021/03/30/arduino-using-libraries/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.