Comments on: ESP32 CYD with LVGL: Digital Clock with Time and Date https://randomnerdtutorials.com/esp32-cyd-lvgl-digital-clock/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Sun, 13 Apr 2025 15:43:02 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Stoica Nicolae https://randomnerdtutorials.com/esp32-cyd-lvgl-digital-clock/#comment-1026591 Sun, 13 Apr 2025 15:43:02 +0000 https://randomnerdtutorials.com/?p=161613#comment-1026591 Hello,
I tried the project here and it works fine but I want to change the font like here and I can’t : youtube.com/watch?v=YCTbiHk1MHM

I want to make the time font bigger, 60px:
LV_FONT_DECLARE(POP_60);
text_label_time = lv_label_create(lv_scr_act());
lv_label_set_text(text_label_time, “00:00:00”);
lv_obj_set_pos(text_label_time, 5, 30);
lv_obj_set_width(text_label_time, 200);
lv_label_set_long_mode(text_label_time, LV_LABEL_LONG_CLIP);
static lv_style_t style_text_label;
lv_style_init(&style_text_label);
lv_style_set_text_font(&style_text_label, &POP_60);
lv_style_set_text_align(&style_text_label, LV_TEXT_ALIGN_LEFT);
lv_obj_add_style(text_label_time, &style_text_label, 0);

]]>
By: Roger https://randomnerdtutorials.com/esp32-cyd-lvgl-digital-clock/#comment-1025887 Fri, 11 Apr 2025 16:03:53 +0000 https://randomnerdtutorials.com/?p=161613#comment-1025887 Hello again and an additional question.

(1) The lv_label_set_text is being used in the timer_cb function and in the main_gui function. I couldn’t understand why so I removed them from the main_gui function and the display appears to still function properly. Am I missing something, is there a subtle reason for including them in both functions?

]]>
By: Roger https://randomnerdtutorials.com/esp32-cyd-lvgl-digital-clock/#comment-1025678 Thu, 10 Apr 2025 22:14:22 +0000 https://randomnerdtutorials.com/?p=161613#comment-1025678 I have been using the code and everything works but I have a question about the lv_timer. According to the LVGL documentation the lv_timer_ready(timer) makes the timer run on the next call to the lv_timer_handler(). Where is the call to the handler? Is it the lv_task_handler() called in the void loop()? I guess my question is what makes the timer run?

In addition, what does the LV_UNUSED(timer) statement do in the timer call back function?

Regards,

Roger

]]>
By: Giovanni https://randomnerdtutorials.com/esp32-cyd-lvgl-digital-clock/#comment-1015029 Sun, 09 Mar 2025 15:15:43 +0000 https://randomnerdtutorials.com/?p=161613#comment-1015029 In reply to Sara Santos.

HO seguito tutto alla lettera, ma la mia scheda rimane sempre nera qualsiasi progetto del gruppo carico non so dove sbaglio.
Lo sketch viene caricato ma lo schermo è sempre nero, il messaggio alla fine è:
Leaving…
Hard resetting via RTS pin…
Arduino, Librerie:
ArduinoJson
lvgl
TFT_eSPI
XPT_Touchscreen
lv_conf.h

Nella cartella TFT_eSPI ho sostituito il file TFT_eSPI.h
dove ho sbagliato?

]]>
By: Dave M https://randomnerdtutorials.com/esp32-cyd-lvgl-digital-clock/#comment-1013568 Wed, 05 Mar 2025 13:48:01 +0000 https://randomnerdtutorials.com/?p=161613#comment-1013568 A further update: I have changed text and backlight colours, thx to Dos Santos, Phil & Gerhard for providing clues/pathways. I do not yet possess a microscope etc for SMD work so repairing the dimmer etc is out. For now… I also determined my BME280 module ist kaput but, the clock works fine albeit with ~75 second drift per hour! (Presently the object of intensive investigation) This is terrific hardware for learning when combined with this site. I have seen it mentioned here and in other cyd project comments that the worldtimeapi site is down but, the clock still updates at the top of the hour, fortunately. The server must be working.

I have two more of these DIYmalls CYDs coming from A-zon, as well as other variants. I’m hooked. If only I had more time…

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-cyd-lvgl-digital-clock/#comment-1012814 Mon, 03 Mar 2025 08:50:31 +0000 https://randomnerdtutorials.com/?p=161613#comment-1012814 In reply to Dave M.

That’s great.
I’m glad you enjoyed this tutorial.
Thanks for your nice words.
Regards,
Sara

]]>
By: Dave M https://randomnerdtutorials.com/esp32-cyd-lvgl-digital-clock/#comment-1012550 Sun, 02 Mar 2025 20:53:38 +0000 https://randomnerdtutorials.com/?p=161613#comment-1012550 Thank you! I have been struggling for weeks with Unos, Megas, MKRs and Pis to make a simple clock, only to fail over and over… I just do not know enough about coding yet. I am abundantly aware I should have picked any number of vastly less complicated projects for my first but, that’s not my style! Into the deep end head first! Tallyho!

This project with the amazing CYD was an entirely painless experience that not only works out of the box but, includes code descriptions for the functions! Hooray!!! I have already gotten stuck into the “On/Off” tutorial to begin working on adding that function to this clock. Make it so it wakes with a touch, then goes dark after X seconds. I shall verify if the display dimmer works too and, if not work on that!

I cannot thank you enough for these tutorials… I shall find a more thoughtful way to repay you somehow, that is not just money. If I could I would deliver to you both the most happy and beautiful day you’ve ever experienced and, check the box that says to repeat it over and over, forever.

I chose a clock as my 1st project to replace the one my little Piranha Fish broke when the snooze button didn’t work to her liking and she flattened it, again. By pure chance today is her birthday and I presented her with it. You have made me the most popular husband in Canada.

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-cyd-lvgl-digital-clock/#comment-1007302 Wed, 12 Feb 2025 10:25:47 +0000 https://randomnerdtutorials.com/?p=161613#comment-1007302 In reply to murffyp.

Hi.
Please read carefully all the instructions:
“If you see an Error like this: “Sketch too big” during the uploading process, in Arduino IDE go to Tools > Partition scheme > choose anything that has more than 1.4MB APP, for example: “Huge APP (3MB No OTA/1MB SPIFFS“
Regards,
Sara

]]>
By: murffyp https://randomnerdtutorials.com/esp32-cyd-lvgl-digital-clock/#comment-1007258 Wed, 12 Feb 2025 07:16:16 +0000 https://randomnerdtutorials.com/?p=161613#comment-1007258 Can’t seem to get the code to upload to my CTD (same as used in tutorial). Keep getting error that code exceeds board space (~109%).

Anyway I can compact the code any (sorry, new to Arduino and don’t know where to start in that respect).

Thanks in advance for any help.

]]>
By: JCL https://randomnerdtutorials.com/esp32-cyd-lvgl-digital-clock/#comment-1003901 Thu, 30 Jan 2025 21:50:30 +0000 https://randomnerdtutorials.com/?p=161613#comment-1003901 I don’t understand why you are pulling the time from WorldTime API? If the ESP32 has to connect to the local router anyway, why not simply pull the time from the ESP32’s own internal RTC since it is connected to the network and syncing time to the local router, which is syncing it’s time with a NIST Internet Time Server. Seems silly to have to make a separate internet request to WorldTimeApi if the ESP32’s internal clock already knows what time it is as soon as it is connected to the local router.

]]>