The Adafruit 2.8inch Resistive TFT is a versatile and vibrant touch screen display module that features a 2.8-inch color TFT LCD screen. With resistive touch capability, it offers a resolution of 320x240 pixels, enabling it to display detailed graphics and text. This module is widely compatible with various microcontrollers and single-board computers, such as the Arduino UNO, making it an excellent choice for embedded applications ranging from handheld devices to interactive control panels.
Pin Number | Pin Name | Description |
---|---|---|
1 | VCC | Power supply (3.3V to 5V) |
2 | GND | Ground |
3 | CS | Chip Select for the TFT |
4 | RESET | Reset pin for the TFT |
5 | D/C | Data/Command control pin |
6 | MOSI | Master Out Slave In for SPI communication |
7 | SCK | Serial Clock for SPI communication |
8 | MISO | Master In Slave Out for SPI communication |
9 | T_CS | Chip Select for the touch screen |
10 | T_IRQ | Touch screen interrupt 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.reset();
uint16_t identifier = tft.readID();
tft.begin(identifier);
tft.fillScreen(BLACK);
tft.setCursor(0, 0);
tft.setTextColor(WHITE);
tft.setTextSize(1);
tft.println("Hello, World!");
}
void loop() {
// Main loop - No code needed for static display
}
Ensure you have installed the Adafruit GFX and TFTLCD libraries before uploading this code to your Arduino UNO.
Q: Can I use this display with a 5V microcontroller? A: Yes, the display is 5V tolerant, but it is recommended to use a level shifter for logic levels.
Q: How do I calibrate the touch screen? A: Adafruit provides a calibration sketch that can be used to calibrate the touch screen. Follow the instructions in the sketch comments.
Q: Can I display images on the screen?
A: Yes, the Adafruit GFX library supports bitmap images. You can use the drawBitmap
function to display images stored in the microcontroller's memory.
For further assistance, consult the Adafruit forums or the community resources available for the Adafruit 2.8inch Resistive TFT.