Components Required

Image Component Quantity Available in Kit
evive 1
USB A-B Cable 1

Introduction

A library is a group of functions and declarations, exposed for use in Arduino IDE scripts. The library therefore consists of an interface expressed in a .h file (named the “header”) and an implementation expressed in a .cpp file. The header file contains all the declarations and the .cpp file contains definitions of functions declared in the header file.

Libraries makes it easy for you to connect to a sensor, display, module, etc. For example if you want to control your evive TFT display, you can use evive Library. It has predefined functions to write text, draw line and many more. Hence you don’t have to make all the complicated functions on your own, you have to just use the corresponding library.

Installing a library

There are three ways in which you can install a library:

  1. Using the Library Manager
  2. Importing a .zip Library
  3. Manual Installation (Not covered in this tutorial. To know more visit here)
evive Alert
Alert: For installing evive library, method 1 is not recommended and only method 2 and method 3 are recommended.

Using the Library Manager

To install a new library into your Arduino IDE you can use the Library Manager. Open the IDE and click to the “Sketch” menu and then Include Library > Manage Libraries.

Manage Libraries

Then the library manager will open and you will find a list of libraries that are already installed or ready for installation. Scroll the list to find the library you want you install, then select the version of the library you want to install. Sometimes only one version of the library is available.

Finally click on install and wait for the IDE to install the new library. Downloading may take time depending on your connection speed. Once it has finished, an Installed tag should appear next to the installed library. You can close the library manager.

Importing a .zip Library (evive Library Installation)

Libraries are often distributed as a ZIP file or folder. For this example we will import evive library. You can download it from here. Generally, the name of the folder is the name of the library. Inside the folder there will be a .cpp file, a .h file and often a keywords.txt file, examples folder, and other files required by the library. Do not unzip the downloaded library, leave it as is.

In the Arduino IDE, navigate to Sketch > Include Library. At the top of the drop down list, select the option to “Add .ZIP Library”.

You will be prompted to select the library you would like to add. Navigate to the evive.zip file’s location and open it.

Return to the Sketch > Import Library menu. You should now see the library at the bottom of the drop-down menu. It is ready to be used in your sketch. The zip file will have been expanded in the libraries folder in your Arduino sketches directory.

evive Notes Icon
Note: The Library will be available to use in sketches, but examples for the library will not be exposed in the File > Examples until after the IDE has restarted.

Including Library in your Sketch

To include a library in a sketch, navigate to Sketch > Include Library and select the library you want to include.

Add evive Library

In this example we have included evive.h.

Included evive.h

evive Notes Icon
Note: If you are facing any problem, or unable understand some steps, please post it on our forum.