Tags:
tag this topic
create new tag
view all tags
---+ LVGL on the T-Watch 2020 ---++ Introduction Since the t-watch 2020 has a rather high resolution screen in combination with a touch panel, it is possible to run <b>G</b>raphical <b>U</b>ser <b>I</b>nterfaces (!GUIs) right on the watch. A popular !GUI library is [[https://docs.lvgl.io/v7/en/html/index.html][lvgl ]](<b>Li</b>ght and <b>V</b>ersatile <b>G</b>raphics <b>L</b>ibrary). This library is written in C but !MicroPython [[https://github.com/lvgl/lv_binding_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 [[https://github.com/uraich/twatch-2020-micropython][twatch-2020-micropython]] github repository integrating all these bits and pieces. This repository is based on * https://github.com/OPHoperHPO/lilygo-ttgo-twatch-2020-micropython/blob/master/README.md * https://github.com/lvgl/lv_micropython There is also a big collection of [[https://github.com/lvgl/lv_examples][example programs]] available for both languages. ---++ Software available for the T-Watch The factory firmware is [[https://github.com/sharandac/My-TTGO-Watch][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 [[https://github.com/Xinyuan-LilyGO/TTGO_TWatch_Library/tree/master/src][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. <img alt="lvgl_bar_code.png" height="198" src="%ATTACHURL%/lvgl_bar_code.png" title="lvgl_bar_code.png" width="365" /> <img alt="lvgl_bar.png" height="279" src="%ATTACHURL%/lvgl_bar.png" title="lvgl_bar.png" width="242" /> -- %USERSIG{UliRaich - 2021-01-08}% ---++ Comments %COMMENT%
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
png
lvgl_bar.png
r1
manage
4.2 K
2021-01-08 - 11:17
UliRaich
png
lvgl_bar_code.png
r1
manage
22.0 K
2021-01-08 - 11:17
UliRaich
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r3 - 2021-01-29
-
UliRaich
Home
Site map
AFNOG web
Embedded_Systems web
IoT_Course_English web
IoT_Course_French web
Main web
Sandbox web
TWiki web
IoT_Course_English Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
E
dit
A
ttach
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback