CNAP
03 / Templates · intermediate

ILI9341 TFT DISPLAY

Open in Playground

240×320 colour TFT display over SPI. Draws a red rectangle, cyan circle, and white text using the Adafruit ILI9341 library. Runs on 3.3V logic — add level shifters on real 5V hardware.

intermediateTFTSPIdisplayILI9341colour
Circuit
Code
sketch.inoArduino C++
24 lines
// ILI9341 TFT — draws coloured shapes
#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() {}
Components
  • Arduino Uno
    01
  • ILI9341 TFT Display (wokwi-ili9341)
    02
Wiring
Component PinArduino Pin
VCC3.3V
GNDGND
CS (Chip Select)Pin 10
RST (Reset)Pin 9
D/C (Data/Command)Pin 8
MOSIPin 11 (MOSI)
SCKPin 13 (SCK)
MISOPin 12 (MISO)
LED (Backlight)3.3V (via 100 Ω in real HW)