The 1.3 inch TFT Module 240×240 ST7789 by Adafruit (part ID: GMT130-V1.0) is a compact and vibrant display module suitable for adding a colorful and high-resolution interface to your electronics projects. This module uses a thin-film-transistor (TFT) LCD to provide a bright and clear display with a 240x240 pixel resolution. The ST7789 driver integrated into the module allows for efficient communication and control over the display using a microcontroller, such as an Arduino UNO.
Pin Number | Pin Name | Description |
---|---|---|
1 | GND | Ground |
2 | VCC | Power supply (3.3V) |
3 | SCL | Serial Clock for SPI |
4 | SDA | Serial Data for SPI |
5 | RES | Reset pin |
6 | DC | Data/Command control pin |
7 | CS | Chip Select for SPI |
8 | BLK | Backlight control (PWM capable) |
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
// Pin definitions
#define TFT_CS 10 // Chip select line for TFT display
#define TFT_RST 9 // Reset line for TFT (or connect to +3V3)
#define TFT_DC 8 // Data/command line for TFT
#define TFT_BL 7 // Backlight control pin (optional)
// Initialize Adafruit ST7789 TFT library
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);
void setup() {
pinMode(TFT_BL, OUTPUT); // Set backlight pin to output mode
digitalWrite(TFT_BL, HIGH); // Turn on the backlight
tft.init(240, 240); // Initialize display with its resolution
tft.fillScreen(ST77XX_BLACK); // Clear the screen to black
}
void loop() {
// Example display code
tft.setTextColor(ST77XX_WHITE);
tft.setTextSize(1);
tft.setCursor(20, 20);
tft.print("Hello, World!");
}
Q: Can I use this display with a 5V microcontroller? A: Yes, but you will need to use a level shifter or logic level converter to protect the 3.3V logic of the display.
Q: Is it possible to use this display without an SPI interface? A: No, this display requires an SPI interface for communication with the microcontroller.
Q: How can I increase the brightness of the display? A: You can increase the brightness by providing a higher duty cycle PWM signal to the BLK pin.
Q: What library should I use for this display? A: The Adafruit_GFX and Adafruit_ST7789 libraries are recommended for interfacing with this display.
Q: Can I display images or animations on this screen? A: Yes, the display is capable of showing images and animations. You will need to use the Adafruit_GFX library functions to draw images and update the display accordingly.