Member-only story
Programming the T-WATCH-2020 — Part 2
Using the TTGO T-Watch Library
Part 1 of this series described setting up the Arduino Development Environment for the T-Watch, and Part 2 will provide details of the TTGO T-Watch Library (which is great but has a poorly documented API).
Using the TTGO T-Watch Library
Documentation of the API is sparse so the examples supplied with the T-Watch Library are the best place to start (File > Examples > TTGO TWatch Library
). The BasicUnit
folder includes examples of how to access the various peripherals included with the watch. The ClientProject > SimpleFramework
is a simple digital watch and calendar (Figure 20).

A full list of the examples available plus a short description are provided in the TTGO T-Watch Library GitHub repository (Figure 21).

Light and Versatile Graphics Library (LVGL)
Alternatively, you can use the included Light and Versatile Graphics Library (LVGL) to display a watch face (e.g., the LVGL > BatmanDial
— Figure 22). The SimpleWatch
example in the LVGL
folder didn’t compile for our v1 T-Watch.

LVGL (Figure 23) is a popular open source embedded graphics library, used to create UIs for any MCU, MPU and display type. It’s supported by Arm, STM32, NXP, Espressif, Nuvoton, Arduino, RT-Thread, Zephyr, NuttX, Adafruit and many more. The LVGL library can use UIs built with SquareLine Studio.
