Example Code for Raspberry Pi Pico-GDI TFT LCD Display

The screen will display the text "DFROBOT" after the sample code is downloaded.

Hardware Preparation

Software Preparation

Download 1.8" 128*160 TFT LCD Display Library

Wiring Diagram

Function & Pin Description of the Board GDI

NO. Finction Pin Number
1 GPIO IO20
2 CS IO19
3 RST IO18
4 SCK IO16
5 MOSI IO8
6 MISO IO9
7 GPIO IO15
8 GPIO IO14
9 CS-SD IO2
10 CS-LCD IO5
11 RESET IO17
12 D/C IO13
13 MISO IO4
14 MOSI IO7
15 SCK IO6
16 Ground GND
17 BLK IO12
18 Power 3V3

Sample Code

#include "DFRobot_GDL.h"

#define TFT_DC  13
#define TFT_CS  5
#define TFT_RST 17
#endif

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(2);
  screen.fillScreen(COLOR_RGB565_BLACK);
  screen.setFont(&FreeMono12pt7b);
  screen.setCursor(/*x=*/32,/*y=*/64);
  screen.setTextColor(COLOR_RGB565_LGRAY);
  screen.setTextWrap(true);
  screen.print("DFRobot");
  delay(500);

Result

Program description: the screen will display the blue text "DFROBOT".

Additional Information

Was this article helpful?

TOP