Display incremental Slider/Bar during ESP32 Setup

What do you want to achieve?

Show an incremental slider/bar during setup of an ESP32.

What have you tried so far?

void setup()
{
  lv_init();
  tft.begin();          /* TFT init */
  tft.setRotation( 0 ); /* Landscape orientation, flipped */

  //... snip ...

  ui_init();
  for (int i=0; i < 100; i++) {
    lv_slider_set_value(ui_BootSlider, i, LV_ANIM_OFF);
    lv_event_send(ui_BootSlider, LV_EVENT_VALUE_CHANGED,  NULL);
    delay(100);
  }
}

Afer about 10 seconds the slider is shown 100% without showing any values in between.

Others

  • SquareLine Studio version:
    SquareLine_Studio_Linux_v1_2_0
  • Operating system:
    Ubuntu 20.04.5 LTS
  • Target hardware:
    ESP32-Wroom-32

Hi,

LVGL refreshes the screen in lv_timer_handler. In your cycle lv_timer_handler is not called, so LVGL can’t refresh the screen.

To solve this you can call lv_refr_now(NULL) before the delay().

Thanks! That worked