#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <SPI.h>
// Define ESP32 TFT connections
#define TFT_CS 5
#define TFT_DC 2
#define TFT_RST 4
#define TFT_LED 3.3
// Initialize TFT display
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
void setup() {
tft.begin();
tft.setRotation(3); // Landscape mode
// Show the animated text
showAnimatedText();
// Show loading screen
showLoadingScreen();
}
void loop() {
// Nothing here, as it's just a demo
}
// Function to show "Thennal Air Filters" letter by letter in Indian colors
void showAnimatedText() {
tft.fillScreen(ILI9341_BLACK);
tft.setTextSize(3);
tft.setTextColor(ILI9341_ORANGE);
const char *text = "Thennal Air Filters";
int x = 10;
int y = 100;
int delayTime = 200; // Delay between letters
for (int i = 0; text[i] != '\0'; i++) {
if (i < 7) tft.setTextColor(ILI9341_ORANGE); // First part (Orange)
else if (i < 11) tft.setTextColor(ILI9341_WHITE); // Middle part (White)
else tft.setTextColor(ILI9341_GREEN); // Last part (Green)
tft.setCursor(x, y);
tft.print(text[i]);
x += 18; // Adjust spacing
delay(delayTime);
}
delay(2000); // Hold for 2 seconds before moving to the next screen
}
// Function to show rotating ring animation with "Initializing Setup..."
void showLoadingScreen() {
tft.fillScreen(ILI9341_BLACK);
tft.setTextSize(2);
tft.setTextColor(ILI9341_WHITE);
tft.setCursor(60, 180);
tft.print("Initializing Setup...");
int centerX = 160, centerY = 120, radius = 20;
for (int i = 0; i < 36; i++) { // Rotate animation
tft.fillCircle(centerX + cos(i * 10 * PI / 180) * radius,
centerY + sin(i * 10 * PI / 180) * radius, 5, ILI9341_WHITE);
delay(100);
tft.fillCircle(centerX + cos(i * 10 * PI / 180) * radius,
centerY + sin(i * 10 * PI / 180) * radius, 5, ILI9341_BLACK);
}
delay(5000); // Hold for 5 seconds before stopping
}