#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#define TFT_CS 15
#define TFT_DC 2
#define TFT_RST -1
#define TFT_BL 21
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
void setup() {
pinMode(TFT_BL, OUTPUT);
digitalWrite(TFT_BL, HIGH);
tft.begin();
tft.fillScreen(ILI9341_BLACK);
// Rainbow gradient background
for (int y = 0; y < tft.height(); y++) {
uint16_t color = tft.color565(
(y * 255) / tft.height(), // Red gradient
(255 - (y * 255) / tft.height()), // Green gradient
(y * 128) / tft.height() // Blue gradient
);
tft.drawFastHLine(0, y, tft.width(), color);
}
// Motivational caption overlay
tft.setCursor(20, 140);
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(2);
tft.println("Code by Arvind");
tft.setCursor(20, 170);
tft.setTextColor(ILI9341_YELLOW);
tft.setTextSize(2);
tft.println("AI Centre Nandurbar");
}
void loop() {
// Nothing here – static demo
}
Loading
esp32-2432s028r
esp32-2432s028r
https://wokwi.com/projects/464323576143519745