The Adafruit 2.0 inch 240x320 IPS TFT is a vibrant, high-resolution display module that is perfect for adding a small but high-quality screen to your electronics projects. With its In-Plane Switching (IPS) technology, it offers a wide viewing angle and accurate color reproduction, which makes it ideal for handheld devices, user interfaces, or any application where visual quality is paramount. This display is commonly used with microcontrollers like the Arduino UNO and single-board computers such as the Raspberry Pi.
Pin Number | Name | Description |
---|---|---|
1 | GND | Ground connection |
2 | VCC | Power supply (3.3V-5V) |
3 | SCK | SPI clock |
4 | MOSI | SPI Master Out Slave In |
5 | CS | Chip Select for SPI |
6 | D/C | Data/Command control pin |
7 | RST | Reset pin |
8 | BL | Backlight control (PWM capable) |
GND
to the ground pin on the Arduino.VCC
to the 5V out pin on the Arduino.SCK
to digital pin 13 (SCK) on the Arduino.MOSI
to digital pin 11 (MOSI) on the Arduino.CS
to a selectable digital pin, for example, digital pin 10.D/C
to another selectable digital pin, for example, digital pin 9.RST
to another selectable digital pin, for example, digital pin 8.BL
to a PWM-capable pin if you wish to control the backlight brightness, for example, digital pin 6.To use the display with an Arduino, you will need to install the Adafruit GFX library and the specific library for the display, which can be found in the Arduino Library Manager.
Here is a simple example code to initialize the display and show some basic graphics:
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_TFTLCD.h> // Hardware-specific library
#define CS 10
#define DC 9
#define RST 8 // You can also connect this to the Arduino reset
Adafruit_TFTLCD tft(CS, DC, RST);
void setup() {
tft.begin(); // Initialize the display
tft.setRotation(1); // Set the rotation
tft.fillScreen(BLACK); // Clear the screen to black
}
void loop() {
// Your code to draw on the display goes here
}
Q: Can I use this display with a 5V Arduino? A: Yes, but make sure to use a level shifter for the data lines to protect the display.
Q: How can I adjust the brightness of the backlight? A: You can connect the BL pin to a PWM-capable pin on your microcontroller and use analogWrite() to adjust the brightness.
Q: What library should I use for this display? A: The Adafruit GFX library along with the Adafruit TFTLCD library is recommended for this display.
For further assistance, consult the Adafruit forums or the community around the specific microcontroller you are using.