From 958f95d26bd47a2a56e28f659d0bf87cdd2af155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Costa?= Date: Tue, 13 May 2025 11:13:39 +0200 Subject: [PATCH] docs: explain how to run other demos and examples (#81) --- README.md | 24 ++++++++++++++++++++++++ main/src/main.c | 6 ++++++ 2 files changed, 30 insertions(+) diff --git a/README.md b/README.md index 3a35af1..6516d13 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,30 @@ cmake .. make -j ``` +## Run demos and examples + +By default, the widgets demo (`lv_demo_widgets()`) will run. If you want to run a different demo or example from the LVGL library, +simply replace the demo function call in the code with another one—such as `lv_demo_benchmark()` or `lv_example_label_1()`. + +```c +int main(int argc, char **argv) +{ + /* ... */ + /* Run the default demo */ + /* To try a different demo or example, replace this with one of: */ + /* - lv_demo_benchmark(); */ + /* - lv_demo_stress(); */ + /* - lv_example_label_1(); */ + /* - etc. */ + lv_demo_widgets(); + + while(1) { + /* ... */ + } + return 0; +} +``` + ## Optional library There are also FreeType and FFmpeg support. You can install these according to the followings: diff --git a/main/src/main.c b/main/src/main.c index 3016c70..b61664f 100644 --- a/main/src/main.c +++ b/main/src/main.c @@ -76,6 +76,12 @@ int main(int argc, char **argv) #if LV_USE_OS == LV_OS_NONE + /* Run the default demo */ + /* To try a different demo or example, replace this with one of: */ + /* - lv_demo_benchmark(); */ + /* - lv_demo_stress(); */ + /* - lv_example_label_1(); */ + /* - etc. */ lv_demo_widgets(); while(1) {