create new tag
view all tags

LVGL on the T-Watch 2020


Since the t-watch 2020 has a rather high resolution screen in combination with a touch panel, it is possible to run Graphical User Interfaces (GUIs) right on the watch. A popular GUI library is lvgl (Light and Versatile Graphics Library). This library is written in C but MicroPython language bindings are available.

In order to bind lvgl into MicroPython, modifications to the MicroPython code are needed. Drivers for the t-watch devices must also be integrated into Micropython. I therefore created the twatch-2020-micropython github repository integrating all these bits and pieces. This repository is based on

There is also a big collection of example programs available for both languages.

Software available for the T-Watch

The factory firmware is https://github.com/sharandac/My-TTGO-Watch. This is a rather complex C++ program using LVGL and the Arduino IDE for platformio. It uses the TTGO_TWatch_Library providing drivers for the T-Watch devices as well as icons and background wallpapers.

Running lv_micropython of the t-watch

MicroPython compiles for the t-watch "out of the box". In order to get a version with lvgl and all drivers and their MicroPython language binding to work is another story. Therefore the repository mentioned above.

The MicroPython language binding contains lvgl initialization code in the module display_driver.py, which makes it very easy to create and run simple lvgl programs on the t-watch. display_driver.py checks on which hardware it is running

  • SDL driver for the uniy port simulating a display
  • ili9341, used e.g. on the LoLin TFT-2.4" display
  • or the t-watch
and performs the necessary actions like registration of the display and touch screen drivers with lvgl.

The code of a very basic example is given below together with a screen dump of what you will see on the t-watch screen.



-- Uli Raich - 2021-01-08


Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng lvgl_bar.png r1 manage 4.2 K 2021-01-08 - 11:17 UliRaich  
PNGpng lvgl_bar_code.png r1 manage 22.0 K 2021-01-08 - 11:17 UliRaich  
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2021-01-29 - UliRaich
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback