-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image redraw and text flicker - TFT_eSPI/ESP32/ILI9488 #504
Comments
@Osocrates it's possible some of your refresh issues is being caused by the drawing inside the box element. Try removing them and see if anything improved if so replace them using the line elements to draw your own boxes. If it's still a problem copy your project to another and remove any sensors and external libs replacing them with hardcoded data so I can run just the GUI. Then post the zip file of your project and I'll see what I can find... Paul-- |
Thanks, that seems to have solved the issue. I guess that the error was due to a bigger redraw sector due to the boxes. I still see a little bit of flicker on the labels, but that might be an effect of the update frequency, and it looks negligible compared to the previous image flicker. |
I have a couple of text labels that update through some variables, currently the same counter. A couple of labels are in a box along with a static string and an image, so when the counter changes, only two labels should change.
However, the static string and the image are also flashing whenever the display updates, and not only that, when checking with DBG_REDRAW you can see that the string and image flash when 3 labels update.
Here's the code I use to update my elements:
` if(((millis()-last_t)>= 10)){
gslc_ElemXRingGaugeSetVal(&m_gui, m_pElemXRingGauge1, valor);
gslc_Update(&m_gui);
gslc_ElemXProgressSetVal(&m_gui, m_pElemProgress1, ((valor - 0) * (42 - 0) / (39.5 - 0) + 0));
gslc_Update(&m_gui);
gslc_ElemXRadialSetVal(&m_gui, m_pElemRadial3, valor);
gslc_Update(&m_gui);
valor+= 1;
//memset(txt_speed, 0, sizeof(txt_speed));
//gslc_ElemSetTxtStr(&m_gui, text_speed , txt_speed);
//gslc_Update(&m_gui);
//gslc_ElemSetTxtStr(&m_gui, text_power , txt_speed);
//gslc_Update(&m_gui);
//gslc_ElemSetTxtStr(&m_gui, text_travdist , txt_speed);
//gslc_Update(&m_gui);
//gslc_ElemSetTxtStr(&m_gui, text_volt , txt_speed);
//gslc_Update(&m_gui);
//memset(txt_speed, 0, sizeof(txt_speed));
snprintf(txt_speed, MAX_STR,"%.1f", valor);
strcat(txt_speed," Km/h");
gslc_ElemSetTxtStr(&m_gui, text_speed , txt_speed);
gslc_Update(&m_gui);
}
if (valor<20){
gslc_ElemSetVisible(&m_gui,icon_battery,false);
gslc_Update(&m_gui);
gslc_ElemSetVisible(&m_gui,icon_brakes,false);
gslc_Update(&m_gui);
}else{
gslc_ElemSetVisible(&m_gui,icon_battery,true);
gslc_Update(&m_gui);
gslc_ElemSetVisible(&m_gui,icon_brakes,true);
gslc_Update(&m_gui);
}`
I use a solid color as a background:
gslc_SetBkgndColor(&m_gui,GSLC_COL_BLACK);
The text was updated successfully, but these errors were encountered: