#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
#include <SPI.h>
// ✅ SAFE PINS (ESP32-C3)
#define TFT_CS 7
#define TFT_RST 2
#define TFT_DC 3
#define TFT_SCLK 4
#define TFT_MOSI 6
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
// Colors
#define BLACK 0x0000
#define WHITE 0xFFFF
#define YELLOW 0xFFE0
#define GREEN 0x07E0
#define RED 0xF800
#define CYAN 0x07FF
void setup() {
SPI.begin(TFT_SCLK, -1, TFT_MOSI, TFT_CS);
tft.initR(INITR_MINI160x80);
tft.setRotation(1);
tft.fillScreen(BLACK);
drawUI();
}
void loop() {
// Demo update (optional)
}
void drawUI() {
tft.fillScreen(BLACK);
// City
tft.setTextSize(1);
tft.setTextColor(WHITE);
tft.setCursor(5, 5);
tft.print("Faisalabad");
// Day
tft.setCursor(100, 5);
tft.print("Friday");
// Weather
tft.setCursor(5, 20);
tft.print("Clouds");
// Date
tft.setCursor(90, 20);
tft.print("13/03/2026");
// Time (BIG)
tft.setTextSize(3);
tft.setTextColor(YELLOW);
tft.setCursor(20, 35);
tft.print("12:45");
// Wind
tft.setTextSize(1);
tft.setTextColor(CYAN);
tft.setCursor(5, 70);
tft.print("Wind: 3.5 m/s");
// Temp
tft.setTextColor(RED);
tft.setCursor(80, 70);
tft.print("Temp: 30C");
// Humidity
tft.setTextColor(GREEN);
tft.setCursor(80, 80);
tft.print("Humi: 60%");
}