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:
parent
09985a8e80
commit
803ca4aa63
@ -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:
|
||||
|
||||
|
@ -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 */
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user