Digital clock help

What do you want to achieve?

i would like to design a digital clock that grabs the real time from a function in the code and displays it on the UI

What have you tried so far?

Nothing

Screenshot or video

Others

  • **SquareLine Studio version: 1.4.0
  • **Operating system:windows 11
  • Target hardware:

You tried nothing so far?
This will require coding, next to a SquareLine project.
What hardware are you targeting?
Start with the basics: show a label on your screen.
Then update the content of that label from your program.
Then I would use an LVGL timer to do a periodic update with the time.
There is plenty of helpful information from both SquareLine and LVGl documentation.
Hope this helps you to start.

I’ve looked through most of the documentation and i did not find any mention of updating the content of a label from inside a program. Maybe if you can point me in the right direction??? Thank you in advance.

I would suggest to have a look at the LVGL documentation: Welcome to the documentation of LVGL! — LVGL documentation
If you want to change the content of a label, refer to the widget documentation: Label (lv_label) — LVGL documentation
To change the contents: lv_label_set_text(label, “New text”)

Hope this helps.

1 Like

Take a look at this simple project.

It’s little more than your requirement, it takes time from NTP server and display it on TFT screen.
Here Analog clock is used and digital clock is much simple.

1 Like