The Adafruit 1.3-inch 240x240 IPS TFT is a compact and vibrant display module suitable for adding a small but high-resolution screen to your electronics projects. With In-Plane Switching (IPS) technology, it offers better viewing angles and color reproduction compared to traditional TFT LCDs. This display is commonly used in wearable devices, portable instruments, and small embedded systems where space is at a premium but a high-quality display is required.
Pin Number | Pin Name | Description |
---|---|---|
1 | GND | Ground |
2 | VCC | Power supply (3.3V) |
3 | SCK | Serial Clock for SPI communication |
4 | MOSI | Master Out Slave In for SPI communication |
5 | CS | Chip Select for SPI communication |
6 | D/C | Data/Command control pin |
7 | RESET | Reset pin |
8 | BL | Backlight control pin |
To use the Adafruit 1.3-inch 240x240 IPS TFT display in a circuit, follow these steps:
#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 6 // 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: Draw a red rectangle
tft.drawRect(50, 50, 100, 100, ST77XX_RED);
}
Ensure you have installed the Adafruit GFX and ST7789 libraries before uploading this code to your Arduino UNO.
Q: Can I use this display with a 5V microcontroller? A: Yes, but ensure that the logic levels for the SPI interface are shifted down to 3.3V.
Q: How can I adjust the brightness of the display? A: Connect the BL pin to a PWM-capable pin on your microcontroller and adjust the duty cycle to control brightness.
Q: Is it possible to use this display for outdoor applications? A: The display can be used outdoors but is not optimized for direct sunlight visibility. Consider an additional sun-readable overlay or shade for better visibility.
For further assistance, consult the Adafruit support forums or the product's official documentation.