Codey OnlineArduino & ESP32 component library › LCD Display TFT 1.3inch ST7789
LCD Display TFT 1.3inch ST7789
Displays

LCD Display TFT 1.3inch ST7789

LCD Display TFT 1.3inch ST7789 240x240 pixels, 3.3V, SPI, RGB

Width: 28.5 mm

Pinout — LCD Display TFT 1.3inch ST7789

Pin Signal Description
GND ground top edge header hole, leftmost labeled GND
VCC power top edge header hole, labeled VCC
SCL SCL top edge header hole, labeled SCL
SDA SDA top edge header hole, labeled SDA
RES digital top edge header hole, labeled RES
DC digital top edge header hole, labeled DC
BLK power top edge header hole, labeled BLK

Example wiring diagram — LCD Display TFT 1.3inch ST7789

From To Wire
board:GND x1:GND black
board:5V x1:VCC red
board:D13 x1:SCL green
board:D11 x1:SDA blue
board:D9 x1:RES yellow
board:D8 x1:DC purple
board:5V x1:BLK red

Example Arduino code — LCD Display TFT 1.3inch ST7789

This example was written and compile-checked for the arduino-uno. Codey Online adapts it to any other supported board for you.

#include <Adafruit_ST7789.h>
#include <SPI.h>

// This example avoids including Adafruit_GFX.h directly.
// Adafruit_ST7789 brings in the graphics library through its own header,
// which prevents duplicate-library compile issues on some Arduino setups.

#define TFT_CS   -1
#define TFT_DC   8
#define TFT_RST  9

Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);

void setup() {
  Serial.begin(9600);
  Serial.println("ST7789 TFT display example");

  // Initialize a common 240x240 ST7789 panel.
  tft.init(240, 240);
  tft.setRotation(0);
  tft.fillScreen(ST77XX_BLACK);

  tft.setTextWrap(false);
  tft.setTextSize(2);
  tft.setTextColor(ST77XX_WHITE);

  tft.setCursor(20, 20);
  tft.println("Hello!");

  tft.setTextColor(ST77XX_CYAN);
  tft.setCursor(20, 50);
  tft.println("ST7789 TFT");

  tft.drawRect(10, 90, 220, 120, ST77XX_YELLOW);
  tft.fillCircle(60, 150, 25, ST77XX_RED);
  tft.fillTriangle(120, 190, 160, 110, 200, 190, ST77XX_GREEN);

  Serial.println("Display initialized.");
}

void loop() {
  // Static demo.
}

Related components

1.28" Round TFT LCD 240x240 (GC9A01, SPI)

1.28" Round TFT LCD 240x240 (GC9A01, SPI)

1602 LCD DISPLAY

1602 LCD DISPLAY

1602 LCD I2C DISPLAY

1602 LCD I2C DISPLAY

8x8 RGB 64 LED Matrix 5V WS2812b

8x8 RGB 64 LED Matrix 5V WS2812b

Build your Arduino or ESP32 project with AI

Describe what you want to build. Codey Online writes the code, draws the wiring diagram, compiles it and flashes your board straight from the browser.

Start for free