The Adafruit 2.4in TFT FeatherWing is a versatile and vibrant display module that features a 2.4-inch color TFT LCD screen with a resolution of 320x240 pixels. This display is capable of showing detailed graphics and text, making it an excellent choice for a wide range of applications, including handheld instruments, user interfaces, and dynamic visual outputs. Its compatibility with the Adafruit Feather ecosystem allows for quick integration and prototyping with a variety of microcontrollers.
Pin Number | Name | Description |
---|---|---|
1 | GND | Ground connection |
2 | 3V | 3.3V power supply |
3 | RST | Reset pin |
4 | CS | Chip Select for the TFT |
5 | SCK | SPI Clock |
6 | MOSI | SPI Master Out Slave In |
7 | MISO | SPI Master In Slave Out (not used) |
8 | DC | Data/Command control pin |
9 | BL | Backlight control pin |
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_TFTLCD.h> // Hardware-specific library
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0
#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
void setup() {
tft.begin(); // Initialize the display
tft.setRotation(1); // Set orientation
tft.fillScreen(BLACK); // Clear the screen with a black background
}
void loop() {
// Example: Draw a red rectangle
tft.fillRect(50, 50, 100, 150, RED);
delay(1000);
// Example: Display text
tft.setCursor(60, 60);
tft.setTextColor(WHITE);
tft.setTextSize(2);
tft.println("Hello, World!");
delay(2000);
}
Q: Can I use this display with a 5V microcontroller? A: Yes, but ensure that the logic levels are shifted to 3.3V to avoid damaging the display.
Q: Is the touch screen feature available by default? A: The resistive touch overlay is optional and requires additional connections and libraries if implemented.
Q: How can I control the backlight brightness? A: Connect the BL pin to a PWM-capable pin and use analogWrite() in your code to adjust the brightness.
For further assistance, consult the Adafruit forums or the detailed product guides available on the Adafruit website.