Page 1 of 1

Printing the Value of Variable Directly on LCD

Posted: 21 Sep 2011 08:41
by shreevs
Hello,
I am new to MIKROE's C. I learnt that while using a 16X2 LCD, if I wanted to print a value contained in a variable, I have to first break it up and make it a char value (0-255) and then convert the number to its ASCII value (+48). This has made the code real long and bit of cumbersome. I wish if it's possible to directly print the value contained in variable (irrespective of its size) instead of going through the above procedure. It will make things lot more easier for novice ppl like me.
Thanks in advance
Shree

Re: Printing the Value of Variable Directly on LCD

Posted: 22 Sep 2011 08:57
by filip
Hi,

You can convert a variable to string, using some of Conversion library routines (like ByteToStr) and display this string to Lcd using Lcd_Out function.
Regards,
Filip.