1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

docs(arduino): update tick setup (#5832)

This commit is contained in:
Gabor Kiss-Vamosi 2024-03-12 08:41:10 +01:00 committed by GitHub
parent 09985a8e80
commit 803ca4aa63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -41,7 +41,6 @@ installed, follow these configuration steps:
2. Go to ``lvgl`` and copy ``lv_conf_template.h`` as ``lv_conf.h`` into the Arduino Libraries directory next to the ``lvgl`` library folder.
3. Open ``lv_conf.h`` and change the first ``#if 0`` to ``#if 1`` to enable the content of the file
4. Set the color depth of you display in :c:macro:`LV_COLOR_DEPTH`
5. Set :c:macro:`LV_TICK_CUSTOM`
Finally the layout with ``lv_conf.h`` should look like this:

View File

@ -77,6 +77,9 @@ void setup()
lv_init();
/*Set a tick source so that LVGL will know how much time elapsed. */
lv_tick_set_cb(millis);
/* register print function for debugging */
#if LV_USE_LOG != 0
lv_log_register_print_cb( my_print );
@ -127,6 +130,5 @@ void setup()
void loop()
{
lv_task_handler(); /* let the GUI do its work */
lv_tick_inc(5); /* tell LVGL how much time has passed */
delay(5); /* let this time pass */
}