Hello everyone ,
I want to print some data on screen on boot up time for some seconds says 3 seconds and then want to fresh screen and print normal data on screen, How to achieve this ,i have tried using sleep or usleep method before calling while(1) ,but not working as it should work.My code flow is like below.
void display_boot_data(void)
{
static lv_obj_t *label_version1;
static lv_style_t style;
int i =0;
lv_obj_t * scr = lv_disp_get_scr_act(NULL);
puts("In thread display\n") ;
lv_style_copy(&style, &lv_style_plain);
style.text.color = LV_COLOR_BLUE;
style.text.font = &lv_font_roboto_28 ;
label_version1 = lv_label_create(scr, NULL) ;
lv_label_set_style(label_version1, LV_LABEL_STYLE_MAIN, &style);
lv_label_set_static_text(label_version1, "Hello world") ;
lv_obj_align(label_version1, NULL, LV_ALIGN_CENTER, 0, 0);
usleep(3000);
lv_label_set_static_text(label_version1, "");
lv_label_set_static_text(label_version2, "");
lv_obj_del(label_version1);
lv_obj_clean(scr);
printf("After 3 sends finished\n") ;
}
int main()
{
while(1) {
lv_tick_inc(5);
lv_task_handler();
usleep(5000);
}
}
Please suggest your opinion on this code . Any give me your valuable suggestion on how to achieve this feature.