[help] 16*2 character lcd problem
Tue Aug 05 2008, 05:27 pm
one more problem ---
how to print numbers ( i.e. 1,2,3,4,5,6,....) without using customized character codes or like characters with single quates ( 'H' ) ?
i want like this ---
datawr(1);
this should print 1 on lcd.
how to print numbers ( i.e. 1,2,3,4,5,6,....) without using customized character codes or like characters with single quates ( 'H' ) ?
i want like this ---
datawr(1);
this should print 1 on lcd.
Tue Aug 05 2008, 09:08 pm
hi rahul,
if u want to display an integer value u have to convert it to ASCII equivalent before sending it to the LCD..u can do that by simply adding 30 to the basic value because value of 0 in ASCII is 48 (decimal), for 1 it is 49.... and so on.
if ur value is in say variable x then u can just write
datawr(x+48) ;
but be careful to check that the value of x does not exceed 9 or the LCD might display some unwanted characters.
if u want to display an integer value u have to convert it to ASCII equivalent before sending it to the LCD..u can do that by simply adding 30 to the basic value because value of 0 in ASCII is 48 (decimal), for 1 it is 49.... and so on.
if ur value is in say variable x then u can just write
datawr(x+48) ;
but be careful to check that the value of x does not exceed 9 or the LCD might display some unwanted characters.
Powered by e107 Forum System