03 / Templates · intermediate
ILI9341 TFT DISPLAY
Open in Playground240×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
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() {}- Arduino Uno01
- ILI9341 TFT Display (wokwi-ili9341)02
| Component Pin | Arduino Pin |
|---|---|
| VCC | 3.3V |
| GND | GND |
| CS (Chip Select) | Pin 10 |
| RST (Reset) | Pin 9 |
| D/C (Data/Command) | Pin 8 |
| MOSI | Pin 11 (MOSI) |
| SCK | Pin 13 (SCK) |
| MISO | Pin 12 (MISO) |
| LED (Backlight) | 3.3V (via 100 Ω in real HW) |