I am trying to program an Arduino Giga Display. I am using LVGL for most of my project, though I do use GigaDisplay_GFX for part of my code right at the start. I am trying to wipe the screen (i.e., go completely white) so that I can show an error message if someone doesn't enter a value then reload the particular menu screen. However, I can't get the screen to blank, and I can't get the error message to show up (it simply shows up as TEXT over the existing screen instead of the error message, but with the right size and alignment). Any ideas about how to fix this?
This is the relevant section of code:
// Label for error message
lv_obj_t * label_error_message_value = lv_label_create(lv_scr_act());
lv_obj_set_style_text_font(label_error_message_value, &lv_font_montserrat_30, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_align(label_error_message_value, LV_ALIGN_CENTER, 0, 0);
// Validating entry
if (value == 0){
DisplayGFX.fillScreen(0xFFFF);
lv_refr_now(NULL);
lv_label_set_text(label_error_message_value, "Error: value cannot equal 0.");
lv_task_handler();
Serial.println("Error: value cannot equal 0.");
delay(1500);
free_number_text_area();
enter_numbers();
return;
}
I'm trying different options, but nothing seems to work. Any suggestions?