Skip to main content
Full color 240x320 2.8” LCD-TFT display with SPI interface

Pin names

VCC
pin
Supply voltage
GND
pin
Ground
CS
pin
Chip select
RST
pin
Reset (not available in simulation)
D/C
pin
Data/command pin
MOSI
pin
SPI data (MCU → LCD)
SCK
pin
SPI clock
LED
pin
Backlight LED (not available in simulation)
MISO
pin
SPI data (LCD → MCU) - optional unless reading data back from LCD
The RST and backlight (LED) pins are not available in the simulation. You can leave MISO disconnected, unless you need to read data back from the LCD.

Attributes

flipHorizontal
string
default:""
Set to “1” to flip the display horizontally
flipVertical
string
default:""
Set to “1” to flip the display vertically
swapXY
string
default:""
Set to “1” to change the orientation of the display (some LCD panels have the X/Y axes swapped)

Using in Arduino

You can use the Adafruit_ILI9341 library or the lcdgfx library to interface with the LCD display. The following code example shows basic usage with Adafruit_ILI9341:
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

#define TFT_DC 9
#define TFT_CS 10
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);

void setup() {
  tft.begin();

  tft.setCursor(26, 120);
  tft.setTextColor(ILI9341_RED);
  tft.setTextSize(3);
  tft.println("Hello, TFT!");

  tft.setCursor(20, 160);
  tft.setTextColor(ILI9341_GREEN);
  tft.setTextSize(2);
  tft.println("I can has colors?");
}

void loop() { }
Run this example on Wokwi

Simulator examples

Build docs developers (and LLMs) love