docs: explain how to run other demos and examples (#81)

This commit is contained in:
André Costa 2025-05-13 11:13:39 +02:00 committed by GitHub
parent c665924470
commit 958f95d26b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 0 deletions

View File

@ -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:

View File

@ -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) {