Hello,
I am trying to find an easy way to change an integer to a character for display on an LCD.
For instance int x = 123 and I want "123" to be displayed. I understand that simply making this a character would display "{".
Right now what I am doing is dividing down (123/100) = 1 and adding 48 to display a "1". Then I subtract 1*100 and continue (23/10), etc, etc. This then becomes more complicated when doing decimals.
There must be an easier way to display an integer. Any one with a better thought or link is greatly appreciated.
I am trying to find an easy way to change an integer to a character for display on an LCD.
For instance int x = 123 and I want "123" to be displayed. I understand that simply making this a character would display "{".
Right now what I am doing is dividing down (123/100) = 1 and adding 48 to display a "1". Then I subtract 1*100 and continue (23/10), etc, etc. This then becomes more complicated when doing decimals.
There must be an easier way to display an integer. Any one with a better thought or link is greatly appreciated.