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

Software Preparation

Wiring Diagram

DFR0923-GDI 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.

DFR0923-GDI result

Was this article helpful?

TOP