Remote-controlled RGB mood light
Warm, cool, rainbow or breathing: cycle lighting moods from your sofa.
Shop by category
Shop all componentsThe LilyGO T-Display has an ESP32 and a 135x240 ST7789 screen on one board, and its two buttons are on GPIO 0 and 35. The TFT_eSPI library has a ready setup file for it (Setup25_TTGO_T_Display), so the screen works without wiring. The clock gets time from an NTP server and the right button flips between 12- and 24-hour display.
Tick anything you already have and the total updates.
LilyGO T-Display ESP32 with 1.14-inch LCD
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB-C, or a LiPo on the board's JST socket.
tdisplay_clock.inoVerify & upload in Electrolark#include <WiFi.h>
#include <TFT_eSPI.h>
#include <time.h>
TFT_eSPI tft;
bool h24 = true;
void setup() {
pinMode(35, INPUT);
tft.init(); tft.setRotation(1); tft.fillScreen(TFT_BLACK);
WiFi.begin("your-wifi", "your-password");
while (WiFi.status() != WL_CONNECTED) delay(300);
configTzTime("IST-5:30", "pool.ntp.org");
}
void loop() {
if (digitalRead(35) == LOW) { h24 = !h24; delay(300); tft.fillScreen(TFT_BLACK); }
struct tm t;
if (!getLocalTime(&t)) return;
char hm[6], date[20];
strftime(hm, sizeof hm, h24 ? "%H:%M" : "%I:%M", &t);
strftime(date, sizeof date, "%a %d %b", &t);
tft.setTextColor(TFT_WHITE, TFT_BLACK);
tft.drawString(hm, 10, 20, 7);
tft.setTextColor(TFT_CYAN, TFT_BLACK);
tft.drawString(date, 10, 100, 4);
delay(500);
}
The wrong TFT_eSPI setup file is selected; enable Setup25_TTGO_T_Display.
Use configTzTime with the zone string, not configTime with zero offsets.
Check the Wi-Fi name and password; the loop waits until it connects.
It keeps counting after the first sync, but needs Wi-Fi after a power cut.
Yes, fetch a free weather API with HTTPClient and draw it under the date.
Yes, with a LiPo on its socket; dim the backlight to save power.
1 part: LilyGO T-Display ESP32 WiFi Bluetooth Dev Board w/ 1.14-Inch LCD. On this page you can tick the parts you already have and add only the rest to your cart.
It is a beginner project and takes about 1 hour. The build on this page has 5 steps.
No. This page has the complete, tested code (tdisplay_clock.ino).
About ₹1,469 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
NTP time on the ESP32; Selecting a TFT_eSPI setup file; Reading on-board buttons.
Warm, cool, rainbow or breathing: cycle lighting moods from your sofa.
Press to roll: the pips tumble and slow down before landing on a number.
Wait for the light, hit the button: how many milliseconds can you beat?
A bright 4-digit clock that keeps time through power cuts.
Learning project. Check every circuit and the datasheet of each part before you power it up.