Ideally, you should never have to concern yourself with what’s going on inside. Libraries are most helpful with code that doesn’t change, as something of a “black box” into which values may be input to execute certain functions automatically. An Arduino library normally includes functions and variables that can be called in the sketch, along with a special function known as a constructor that is used to create instances of a class defined within the library.
What Is an Arduino Library?īeyond an include statement, a library is a collection of code that’s compiled with your main sketch, but isn’t explicitly written out there. In this article, we’ll examine what a library actually is, what’s going on behind the scenes, and introduce you to the world of making your own custom library for code simplification and reuse.