The Adafruit 1.54" 240x240 IPS TFT is a compact and vibrant display module suitable for adding a small but high-resolution color screen to your electronics projects. With In-Plane Switching (IPS) technology, it provides excellent viewing angles and consistent color representation. This display is commonly used in wearable devices, portable instruments, small embedded systems, and any application where a small, colorful, and bright display is needed.
Pin Number | Pin Name | Description |
---|---|---|
1 | GND | Ground |
2 | VCC | Power supply (3.3V - 5V) |
3 | SCL | SPI clock |
4 | SDA | SPI data input |
5 | RES | Reset pin |
6 | DC | Data/command control pin |
7 | CS | Chip select for SPI |
8 | BL | Backlight control (optional PWM input) |
GND
to the Arduino's ground pin.VCC
to the Arduino's 5V or 3.3V output.SCL
to the Arduino's SCK pin (Digital 13).SDA
to the Arduino's MOSI pin (Digital 11).RES
to a digital pin (e.g., Digital 9), for controlling the reset.DC
to another digital pin (e.g., Digital 8), for data/command selection.CS
to the Arduino's SS pin (Digital 10).BL
to a PWM pin if you wish to control the backlight brightness, or to VCC for always-on backlight.To use the display with an Arduino, you will need to install the Adafruit GFX library and the Adafruit ST7789 library, which can be found in the Arduino Library Manager.
Here is a basic example of how to initialize the display:
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
// Pin definitions
#define TFT_CS 10
#define TFT_RST 9 // Or set to -1 and connect to Arduino RESET pin
#define TFT_DC 8
#define TFT_MOSI 11 // Data out
#define TFT_SCLK 13 // Clock out
// Initialize Adafruit ST7789 TFT library
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
void setup() {
Serial.begin(9600);
tft.init(240, 240); // Initialize screen with its resolution
tft.fillScreen(ST77XX_BLACK); // Clear the screen to black
}
void loop() {
// Your code to update the display goes here
}
Q: Can I use this display with a 5V microcontroller? A: Yes, but ensure that the logic levels are compatible or use a level shifter.
Q: How can I control the backlight brightness? A: Connect the BL pin to a PWM-capable pin on your microcontroller and use analogWrite() to adjust the brightness.
Q: What libraries do I need to use this display with an Arduino? A: You will need the Adafruit GFX library and the Adafruit ST7789 library.
Q: Can I use this display in a battery-powered project? A: Yes, the display's low power consumption makes it suitable for battery-powered applications.
For further assistance, consult the Adafruit forums or the product's official documentation.