IOTHUB SOFTWARE · 03

Arduino Library Management

Library errors often look like code errors. In practice, duplicate libraries, wrong versions, and board-specific configuration files cause many failed builds.

Installing Required Libraries hero image
Key TermslibraryTFT_eSPIUser_Setup.hPythonpip

A library is a pre-made bundle of code. It lets us read sensor data and draw text on a screen without writing all the hard parts ourselves.


How to Install

In Arduino IDE, open ToolsManage Libraries or click the library icon on the left. Search the name and press Install.


Libraries Used Across the Series

LibrarySearch keywordNeeded inInstall
Adafruit SSD1306Adafruit SSD1306Parts 2-20 (OLED)Required
Adafruit GFXAdafruit GFXParts 2-20 (OLED)Required
TFT_eSPITFT_eSPIParts 21-22 (TFT)Only when using TFT
XPT2046_TouchscreenXPT2046_TouchscreenPart 22 (touch)Only for touch TFT
DHT sensor libraryDHT sensor libraryParts 3, 6, 7, 19Only for DHT22
OneWireOneWireParts 5, 8Only for DS18B20
DallasTemperatureDallasTemperatureParts 5, 8Only for DS18B20
IRremoteESP8266IRremoteESP8266Part 17Only for IR control
HX711HX711Part 18Only for load cells
If you are just starting, install only Adafruit SSD1306 and Adafruit GFX. That is enough to begin Part 2. Install the others when each part asks for them.

Python Libraries

Parts 23-24 also need Python libraries. Install them in the terminal:

bash
pip install flask requests
LibraryPurposeUsed in
flaskWeb serverPart 24, AI broker
requestsHTTP and TLS communicationPart 24, AI API calls

When It Does Not Work

ProblemFix
Library does not appear in searchCheck spelling. Adafruit must be typed correctly.
Install failsCheck internet connection. On Windows, try running Arduino IDE as administrator.
TFT libraries conflictWhen using TFT_eSPI, remove unnecessary TFT libraries such as Adafruit_ILI9341.

Treat libraries as project dependencies

A library is not just an installed helper. It is part of the project environment. Record the exact library name, author, and version that compiled successfully so the project can be rebuilt later.

Compile examples first

Before using project code, compile the simplest official example from the library. If the example fails, the project code is not the first thing to debug.

Practical library rules

When compilation fails

Read the first library name in the error output, verify that the example sketch compiles, and check whether Arduino IDE is using a duplicate library from another folder.