2.4-2.8-3.5 inch ESP32 Display PlatformIO Tutorial
Overview¶
This tutorial is for 2.4-inch/2.8-inch/3.5-inch ESP32 HMI display.
Resources¶
Software Preparation¶
First download Visual Studio Code on https://code.visualstudio.com/. Choose the version that is compatible with your computer system and download it
![]()
Open VSCode and click on Extension, search for Python and install.
![]()
Search for PlatformIO and install it.
![]()
Create new projects¶
Click on the PlatformIO icon, click the quik access "Open", then click "+New Project"
![]()
Add the project name. The board select "Denky(WROOM32)", framework select Arduino
![]()
The main part of the program will be written in main.cpp
![]()
Download the lvgl and TFT_eSPI library
![]()
We can see that the library has been added successfully!
![]()
Configure the libraries¶
TFT_eSPI¶
Delete the original User_Setup.h in the TFT_eSPI folder, and copy the User_Setup.h provided to the folder.

LVGL¶
Right-click the lvgl and open in files explorer

Move the demos and examples folder to src folder

Place the lv_conf.h file under the donky32 directory

UI¶
Put the UI files to the right folder. (The UI files are generated from the SquareLine Studio)

The .c files should be in the /src folder, and the .h files should be /include folder.
Compile and upload the code¶
After the configuration is complete, write the code in main.cpp.
Then we can compile the program.
Upload the code and press reset button, the program will run on the board!
![]()