PDA

View Full Version : LCD automatic management?



ruijc
- 25th September 2008, 11:50
Greetings,

I finished one more aplication but i just dont like the visual outcome on my LCD.

I have a common 16x2 LCD and i have a screen where i have on the first line the Max value, Average value and minimum value indications and for the second line shows the values.

The problem is that with 3 digit values the spacing is correct, but with 1 digit values the spacing is way off ( please see attached pictures ).
There would be nice if the values were always under the names.

Is there a simple way or making it automatic to manage the screen according to the value sizes ?

Thanks

mackrackit
- 25th September 2008, 12:51
Looks like you are just putting a "space" between the values on the second line.

The first position on the second line is 80. If you always want something to start at the second position then tell it to start at 80+2., then the nest set of data could start at 80+7 and so on.

The only problen is if the data is to long to fit in the space provided.

ruijc
- 25th September 2008, 13:21
Hi mackrackit,

thanks for your help

The values will only have 3 digits max.

This is the code i used:


lcdout $fe,2," MAX AVG MIN "
lcdout $fe,$c0," ",DEC MAXIMO,"C ",DEC MEDIA,"C ",DEC MINIMO,"C "

I'm not able to try this now, but your sugestion is something like this ?



lcdout $fe,2," MAX AVG MIN "
lcdout $fe,81,DEC MAXIMO,"C"
lcdout $fe,87,DEC MEDIA,"C"
lcdout $fe,8c,DEC MINIMO,"C"


My best regards
Rui

mackrackit
- 25th September 2008, 13:35
CORRECTION... I said second line 80... C0 is correct.

So


lcdout $fe,2," MAX AVG MIN "
lcdout $fe,C0,DEC MAXIMO,"C" 'Starts at fist space
lcdout $fe,C6,DEC MEDIA,"C" 'Starts at space 6
lcdout $fe,CB,DEC MINIMO,"C" 'Starts at space 11

ruijc
- 25th September 2008, 13:42
thanks ;)

.

Archangel
- 25th September 2008, 17:04
CORRECTION... I said second line 80... C0 is correct.

So


lcdout $fe,2," MAX AVG MIN "
lcdout $fe,C0,DEC MAXIMO,"C" 'Starts at fist space
lcdout $fe,C6,DEC MEDIA,"C" 'Starts at space 6
lcdout $fe,CB,DEC MINIMO,"C" 'Starts at space 11

Ahem: 80 <>$80

mackrackit
- 25th September 2008, 19:58
Ahem: 80 <>$80
OOPPS :o

Thanks Joe


lcdout $fe,$C0,DEC MAXIMO,"C" 'Starts at fist space
lcdout $fe,$C6,DEC MEDIA,"C" 'Starts at space 6
lcdout $fe,$CB,DEC MINIMO,"C" 'Starts at space 11

ruijc
- 25th September 2008, 20:29
I noticed that typo, was just checking the code

A bit of fine tunning and...perfect :D

Thanks guys ;)

.

Archangel
- 26th September 2008, 02:00
I noticed that typo, was just checking the code

A bit of fine tunning and...perfect :D

Thanks guys ;)

.Pretty sure you saw the typo, the reason to correct is 2 years from now a newbie wanders in from out in the cold with the same question, and gets confused. This way the thread ends useful to others, that's all.

ruijc
- 26th September 2008, 11:24
Hi Joe S.,

you are correct in every way.

The only reason i didnt posted it was because at that time i was testing the code and waiting to see the results to post also the results ;)

.