1.4 Install libraries (Important)

Download the Code

Download the relevant code from the link below.

Add libraries

A library, gathering some function definitions and header files, usually contains two files: .h (header file, including function statement, Macro definition, constructor definition, etc.) and .cpp (execution file, with function implementation, variable definition, and so on). When you need to use a function in some library, you just need to add a header file (e.g. #include <dht.h>), and then call that function. This can make your code more concise. If you don’t want to use the library, you can also write that function definition directly. Though as a result, the code will be long and inconvenient to read.

Some libraries are already built in the Arduino IDE, when some others may need to be added. So now let’s see how to add them.

  1. Open the Arduino IDE and go to Sketch -> Include Library -> Add .ZIP Library.

    ../../_images/a2dp_add_zip.png
  2. Navigate to the directory where the library files are located, such as the kepler-kit-main\arduino\libraries folder, and select the desired library file, like LiquidCrystal_I2C.zip. Then, click Open.

    ../../_images/a2dp_choose.png
  3. After a short while, you will receive a notification indicating a successful installation.

    ../../_images/a2dp_success.png
  4. Repeat the same process to add the other libraries.

Note

The libraries installed can be found in the default library directory of the Arduino IDE, which is usually located at C:\Users\xxx\Documents\Arduino\libraries.

If your library directory is different, you can check it by going to File -> Preferences.

../../_images/install_lib1.png