AnsweredAssumed Answered

TWR-LCD eGUI 3.00 & LABEL LIVE UPDATE

Question asked by Eric_t d on Nov 28, 2017
Latest reply on Nov 30, 2017 by TomE

Hi

I am using TWR-LCD and eGUI 3.00.

I am tring to display live data using the D4D_LabelSetText.

The code is the follow:

// Screen "Main" function called periodically in each D4D_poll runs
static void myScreenAbout_OnMain()
{
D4D_TCHAR buff[10];

//(void) sprintf(buff, "%lx", k);
buff[1] = 0;

if (k < 1000) buff[0] = '1';
else if (k < 2000) buff[0] = '2';
else if (k < 3000) buff[0] = '3';
else if (k < 4000) buff[0] = '4';
else if (k < 5000) buff[0] = '5';
else k=0;

D4D_LabelSetText(&my_label, buff);
}

The problem is that the values are overwritten instead of only display the last value 

If I switch transparency off (#define D4D_FNT_PRTY_TRANSPARENT_NO_MASK), I am not able to draw label's text and have the same background color.

Does anyone know how I can redraw the label text, erasing the old text and keep background color?

 

thank you.  

 

 

Outcomes