Label_Caption?Update

General discussion on Visual GLCD Software.
Post Reply
Author
Message
Vineyards
Posts: 73
Joined: 25 Feb 2008 22:12

Label_Caption?Update

#1 Post by Vineyards » 03 Sep 2011 23:31

Seems like a simple problem but I couldn't make it work. I am trying to copy the value obtained from an ADC reading to a text_caption and it works.
But when a new value is drawn on it, it just superimposes. Naturally I thought about writing blank text on the same location but it doesn't work. How do you do this?
What is the best practice for providing a flicker free and non-garbling display?

Code: Select all

char adctxt[7];
unsigned int adcval, adcold;

void main() {
adc_init();
Start_TP();
while (1) {
adcval=adc_read(0);
delay_us(10);
inttostr(adcval,adctxt);
ltrim(adctxt);

if (adcval != adcold){
strcpy(Label6.Caption,"     ");
DrawLabel(&label6);
strcpy(Label6.Caption,adctxt);
DrawLabel(&label6);
adcold=adcval;
}
}
}


Vineyards
Posts: 73
Joined: 25 Feb 2008 22:12

Re: Label_Caption?Update

#2 Post by Vineyards » 07 Sep 2011 20:33

Let me try to ask a specific question. When you use a button for displaying the value of a variable, there are no problems but since the buttons are black and not suitable for this purpose you would use a text label instead. With text labels however, there is the problem of garbling. Above code doesn't help. If there is a way out from this please let me know.

I would use t6963_Write_Text command but then how do I use the fonts?

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: Label_Caption?Update

#3 Post by janko.kaljevic » 08 Sep 2011 16:06

Hello,

You can write the adcold value with color set to background color instead of blank text.
This way you will erase the previous text. And then you can write new value on the screen.

Best regards.

Post Reply

Return to “Visual GLCD General”