Beginner's question: how to use the examples from the LVGL Github reporitory in VS Code?

Hello,

I have a very basic beginner’s breakdown request on getting started. I have my ESP32 display connected (and it works just fine with someone else’s project that they sent me!), I have installed VS Code, I know the buttons “PORT”, “TARGET”, “build”, “flash”, “monitor”, and I have cloned the LVGL repository from the following location:

https://github.com/lvgl/lvgl.git

In my VS Code I opened the folder with this LVGL repository, and on the left-hand-side of my VS Code IDE I have a folder tree including examples, such as

… → examples → widgets → label → lv_example_label_1.c

How can I use these examples to build a project, because I cannot just run that file “lv_example_label_1.c”, I assume?

TIA,
Aswe-24

There are few things you need to do before that

  1. You need to copy the examples folder under: \libdeps\yourboard\lvgl\ to \src\
  2. Then enable LV_BUILD_EXAMPLE to 1 in lv_conf.h file
/*Enable the examples to be built with the library*/
#define LV_BUILD_EXAMPLES 1
  1. include “#include <examples/lv_examples.h>” in your main cpp file
  2. run the wanted example under void setup, e.g.
 lv_example_label_1();

Dear maxchuah,

Thank you for your kind reply. I am trying to implement this.

Have a great week,
Aswe