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).

Figure 20. Examples > ClientProject > SimpleFramework

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

Figure 21. Extract of TTGO_TWatch_Library/docs/examples_en.md (source)

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.

Figure 22. Examples > LVGL > BatmanDial

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.

Figure 23. Sample UI built using LVGL (source)

The Basics & Configuration

--

--

David Such
David Such

Written by David Such

Reefwing Software · Embedded Systems Engineer · iOS & AI Development · Robotics · Drones · Arduino · Raspberry Pi · Flight Control

Responses (2)

Write a response