CNAP

ILI9341 TFT Reference

A 240×320 colour TFT display driven over SPI, 3.3V logic.

Pin names

NameDescription
VCCPower (3.3V)
GNDGround
CSChip Select
RSTReset
D/CData/Command
MOSISPI data in
SCKSPI clock
LEDBacklight
MISOSPI data out

Attributes

This component has no configurable attributes.

Usage

Connect VCC and LED to 3.3V, GND to GND, MOSI/SCK/MISO to the board's hardware SPI pins (11/13/12 on an Uno), and CS, RST, D/C to any free digital pins. Drive it with the Adafruit ILI9341 + GFX libraries.

#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <SPI.h>

#define TFT_CS  10
#define TFT_RST  9
#define TFT_DC   8

Adafruit_ILI9341 tft(TFT_CS, TFT_DC, TFT_RST);

void setup() {
  tft.begin();
  tft.setRotation(1);          // landscape
  tft.fillScreen(ILI9341_BLACK);
  tft.fillRect(10, 10, 100, 60, ILI9341_RED);
  tft.fillCircle(200, 100, 40, ILI9341_CYAN);
  tft.setTextColor(ILI9341_WHITE);
  tft.setTextSize(2);
  tft.setCursor(20, 90);
  tft.print("ILI9341!");
}

void loop() {}

This display runs on 3.3V logic — on real 5V hardware, add level shifters on the SPI and control lines. Power the backlight (LED) through a 100 Ω resistor in real hardware.

Examples

DescriptionAttrs
Default 240×320 TFT{}

See also

  • SSD1306 OLED — smaller monochrome alternative over I²C
  • LCD 1602 — text-only alternative using a parallel bus