Arduino Libraries
Libraries are reusable programs that serve a specific function. Usually, libraries are written for tasks to be performed by almost all application programs so that every application programmer does not have to rewrite the same code. Libraries are usually handy, especially for tasks that involve interfacing with the computer hardware, and since these tasks are not only used by almost every application but also they are complex to program.
Most devices (sensors, displays, communication modules) that connect to an Arduino board come with their libraries, making it easy to write your Arduino sketch that uses the device's functionality. The IDE has many built-in libraries, but you may need to install additional libraries for some components.
Installing Libraries
To install a new library into your Arduino IDE, you can use the Library Manager. Open the IDE and select the Sketch->Include Library->Manage Libraries menu option.
The library manager will display a list of available libraries. Some may be already installed where the text "INSTALLED" is displayed against the library name. If you click on an installed library, you'll find an Update button when a newer version of the library becomes available. To install a new library, scroll down the list to find the library you want to install and click on it. A version selector, if there are multiple versions, an Install button will be displayed. Select the version you want to install and click on the Install button. The library will be downloaded from the web (so you need an active Internet connection) and installed. When installed, the "INSTALLED" text should appear against the library name.
Including a Library in a Sketch
When editing a sketch, if you select the Sketch->Include Library menu option, you will see a list of installed libraries. Now, click on the one you want to include, and the "Include statement" will be added to your sketch. You can then use all the functions offered by the library. The library will be included while compiling the sketch. For example, to include a library using which you can display data from your board on a Liquid Crystal Display (LCD), the following statement is added to the sketch.
#include <LiquidCrystal.h>