#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
// --- Pin Connections for ESP32-S3 + ILI9341 ---
// VCC -> 3.3V
// GND -> GND
// CS -> GPIO5
// DC -> GPIO4
// MOSI -> GPIO6
// SCK -> GPIO7
// RST -> GPIO48
// (CTRL pin 45 not required for ILI9341, can be ignored)
#define TFT_DC 4
#define TFT_CS 5
#define TFT_MOSI 6
#define TFT_CLK 7
#define TFT_RST 48
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
void setup() {
Serial.begin(115200);
Serial.println("ESP32-S3 ILI9341 Graphics Test");
tft.begin();
tft.setRotation(1); // Landscape orientation
tft.fillScreen(ILI9341_BLACK);
// Splash text
tft.setCursor(40, 40);
tft.setTextColor(ILI9341_YELLOW);
tft.setTextSize(2);
tft.println("ESP32-S3 + ILI9341");
delay(2000);
}
void loop() {
// Test 1: Solid fills
tft.fillScreen(ILI9341_RED);
delay(1000);
tft.fillScreen(ILI9341_GREEN);
delay(1000);
tft.fillScreen(ILI9341_BLUE);
delay(1000);
// Test 2: Gradient bars
for (int y = 0; y < tft.height(); y++) {
uint16_t color = tft.color565(y % 64 * 4, 128, 255 - (y % 64 * 4));
tft.drawFastHLine(0, y, tft.width(), color);
}
delay(2000);
// Test 3: Shapes
tft.fillScreen(ILI9341_BLACK);
tft.fillCircle(60, 60, 40, ILI9341_RED);
tft.fillRect(120, 40, 80, 60, ILI9341_BLUE);
tft.drawTriangle(40, 200, 120, 200, 80, 120, ILI9341_GREEN);
delay(2000);
// Test 4: Text showcase
tft.fillScreen(ILI9341_BLACK);
tft.setCursor(20, 40);
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(2);
tft.println("Graphics Test");
tft.setCursor(20, 80);
tft.setTextColor(ILI9341_CYAN);
tft.setTextSize(2);
tft.println("AI Centre Nandurbar");
delay(2000);
}
Loading
esp32-s3-devkitc-1
esp32-s3-devkitc-1