lvgl/demos
2022-04-11 12:44:53 +02:00
..
benchmark docs(demos) update information to reflect new layout (#3029) 2022-01-20 13:52:52 -05:00
keypad_encoder docs(demos) update information to reflect new layout (#3029) 2022-01-20 13:52:52 -05:00
music docs(demos) update information to reflect new layout (#3029) 2022-01-20 13:52:52 -05:00
stress test(demo) add tests for widget and stress demos 2022-01-24 10:55:32 -05:00
widgets fix(demo): added gaurd to prevent crash if default theme is not used (#3257) 2022-04-11 12:44:53 +02:00
lv_demos.h feat: update the cmsis-pack to 0.8.3 (#3021) 2022-01-19 22:31:02 +01:00
lv_demos.mk fix(Makefile): compilation errors (#2944) 2022-01-10 11:17:03 +01:00
README.md fix: increase default value of LV_MEM_SIZE for lv_demo_widgets #3057 (#3058) 2022-01-29 14:34:08 +01:00

Demos for LVGL

Add the examples to your projects

  1. demos can be found in the 'demos' folder once you clone the lvgl.

  2. In the lv_conf.h or equivalent places, you can find demo related macros, change its value to enable or disable specified demos:

...
/*===================
 * DEMO USAGE
 ====================*/

/*Show some widget. It might be required to increase `LV_MEM_SIZE` */
#define LV_USE_DEMO_WIDGETS        0
#if LV_USE_DEMO_WIDGETS
#define LV_DEMO_WIDGETS_SLIDESHOW  0
#endif

/*Demonstrate the usage of encoder and keyboard*/
#define LV_USE_DEMO_KEYPAD_AND_ENCODER     0

/*Benchmark your system*/
#define LV_USE_DEMO_BENCHMARK   0

/*Stress test for LVGL*/
#define LV_USE_DEMO_STRESS      0

/*Music player demo*/
#define LV_USE_DEMO_MUSIC       0
#if LV_USE_DEMO_MUSIC
# define LV_DEMO_MUSIC_SQUARE       0
# define LV_DEMO_MUSIC_LANDSCAPE    0
# define LV_DEMO_MUSIC_ROUND        0
# define LV_DEMO_MUSIC_LARGE        0
# define LV_DEMO_MUSIC_AUTO_PLAY    0
#endif
...
  1. If your development environment or toolchain does not add source files inside 'lvgl' folder automatically, ensure the demos folder is included for compilation.
  2. Include "demos/lv_demos.h" in your application source file, for example:
//! main.c
#include "lvgl.h"
#include "demos/lv_demos.h"
...

Demos

Widgets

Shows how the widgets look like out of the box using the built-in material theme.

See in lv_demo_widgets folder.

Basic demo to show the widgets of LVGL

For running this demo properly, please make sure LV_MEM_SIZE is at least 38KB (and 48KB is recommended):

#define LV_MEME_SIZE    (38ul * 1024ul)

Music player

The music player demo shows what kind of modern, smartphone-like user interfaces can be created on LVGL. It works the best with display with 480x272 or 272x480 resolution.

See in lv_demo_music folder.

Music player demo with LVGL

Keypad and encoder

LVGL allows you to control the widgets with a keypad and/or encoder without a touchpad. This demo shows how to handle buttons, drop-down lists, rollers, sliders, switches, and text inputs without touchpad. Learn more about the touchpad-less usage of LVGL here.

See in lv_demo_keypad_encoder folder.

Keypad and encoder navigation in LVGL embedded GUI library

Benchmark

A demo to measure the performance of LVGL or to compare different settings. See in lv_demo_benchmark folder. Benchmark demo with LVGL embedded GUI library

Stress

A stress test for LVGL. It contains a lot of object creation, deletion, animations, style usage, and so on. It can be used if there is any memory corruption during heavy usage or any memory leaks. See in lv_demo_stress folder. Stress test for LVGL

Contributing

For contribution and coding style guidelines, please refer to the file docs/CONTRIBUTING.md in the main LVGL repo:   https://github.com/lvgl/lvgl