Hi,
on a screen2 I added the EVENT trigger SCREEN_LOADED which calls a function
this function works fine until I add a while loop which waits for a number of serial inputs.
function dosomething() {
int numvalues=10;
char buf[32];
lv_dropdown_get_selected_str(ui_Dropdown2, buf, sizeof(buf));
lv_textarea_add_text(ui_TextArea1, buf);
while (i<numvalues) {
if (hc12.available()) {
message = hc12.readString();
if (message.substring(0,3)=="123") {
numvalues=numvalues+1;
}
}
}
}
It interrupts the MOVE LEFT animation sequence from screen1 to screen2 at about 90% and prevents the add_text.
By using READY instead of SCREEN_LOADED the animation sequence finishes but the add_text doesn’t happen.
How can I get around this?