The China ST7735S 160x128 is a compact 1.8-inch TFT LCD display module that offers a resolution of 160x128 pixels. It is capable of displaying a wide range of colors, making it suitable for a variety of applications, including smartwatches, handheld gaming devices, and other portable electronic gadgets. Its small form factor and low power consumption make it an ideal choice for battery-powered devices.
Pin Number | Pin Name | Description |
---|---|---|
1 | GND | Ground |
2 | VCC | Power supply (3.3V - 5V) |
3 | SCL | Serial Clock Line |
4 | SDA | Serial Data Line |
5 | RES | Reset |
6 | DC | Data/Command control |
7 | CS | Chip Select |
8 | BL | Backlight control (optional PWM dimming) |
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library for ST7735
// Pin definitions
#define TFT_CS 10
#define TFT_RST 9
#define TFT_DC 8
// Initialize Adafruit ST7735S
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
void setup() {
tft.initR(INITR_BLACKTAB); // Initialize display with black tab
tft.fillScreen(ST7735_BLACK); // Fill screen with black color
}
void loop() {
tft.setCursor(0, 0); // Set cursor at top-left corner
tft.setTextColor(ST7735_WHITE); // Set text color to white
tft.setTextWrap(true); // Set text to wrap at end of line
tft.print("Hello, World!"); // Print a message to the screen
}
Ensure you have installed the Adafruit_GFX
and Adafruit_ST7735
libraries before uploading this code to your Arduino UNO.
Q: Can I use this display with a 5V microcontroller? A: Yes, but you will need to use a level shifter for the data lines to convert the logic level to 3.3V.
Q: How can I control the brightness of the backlight? A: You can control the brightness by applying a PWM signal to the BL pin.
Q: What library should I use with this display? A: The Adafruit_GFX and Adafruit_ST7735 libraries are recommended for use with this display.
Q: Is it possible to display images or animations? A: Yes, the display is capable of showing images and animations. You will need to use the appropriate functions provided by the library to do so.