Example Code for Arduino-GDI Interface
Last revision 2025/12/27
This article provides a guide on interfacing Arduino with GDI, including setup and sample code to display '你好' on a TFT LCD.
Hardware Preparation
- FireBeetle 2 ESP32-E IoT Microcontroller (SKU: DFR0654) ×1
- Terminal Block Board for FireBeetle 2 ESP32-E(SKU: DFR0923) ×1
- 1.8inch 128x160 IPS TFT LCD Display(SKU: DFR0928) ×1
- USB Cable ×1
- GDI FPC cable ×1
Software Preparation
- Download Arduino IDE: Click to download Arduino IDE
- Install SDK: click to enter FireBeetle ESP32-E IoT Microcontroller Wiki for SDK installation tutorial
- Download the DFRobot GDL Library: DFRobot GDL Library.
- For Arduino IDE V1.8.19 (or earlier), install the library manually: How to Add a Library?
- For Arduino IDE V2.0.0 (or later), directly search for the "DFRobot GDL Library" in the Library Manager and install it.
Wiring Diagram

Sample Code
Display "你好" on the screen with GDI to domenstrate GDI function.
#include "DFRobot_GDL.h"
DFRobot_ST7735_128x160_HW_SPI screen(/*dc=*/TFT_DC,/*cs=*/TFT_CS,/*rst=*/TFT_RST);
void setup() {
Serial.begin(115200);
screen.begin();
}
void loop() {
screen.setTextSize(4);
screen.fillScreen(COLOR_RGB565_BLACK);
screen.setFont(&SIMKAIFont12pt);
screen.setCursor(/*x=*/10,/*y=*/120);
screen.setTextColor(COLOR_RGB565_BLUE);
screen.setTextWrap(true);
screen.print("你好");
delay(2000);
}
Result
The screen shows the words "你好" in blue.

Was this article helpful?
