LVGL Minimal Examples

This example shows a basic usage with LVGL.

In this example, we make a lv_helper.cpp and lv_helper.h makes it easy to implement LVGL in Arduino. And it is a minimal example for you to start with LVGL

Checkout the LVGL documentation for more information.

Note

If you haven’t download the code:

Download examples from github termod-s3

Unzip the downloaded termod-s3-main.zip

Or just clone the repository

git clone https://github.com/TAMCTec/termod-s3.git

Note

If you don’t have lvgl installed, check this out: Install LVGL Library (Optional).

Open termod-s3/examples/lv_example/lv_example.ino with Arduino IDE.

Remember to select ESP32S3 Dev Module and port, then click upload.

Source code

#include "lv_helper.h"

void setup() {
  Serial.begin(115200);
  lh_init(DISPLAY_LANDSCAPE);
  Serial.println("LVGL Example: Ready");

  lv_obj_t* slider = lv_slider_create(lv_scr_act());
  lv_obj_align(slider, LV_ALIGN_CENTER, 0, 0);
}

void loop() {
  lv_timer_handler();
}