Quote Originally Posted by GioppY View Post
Perhaps i badly explained.
I do not use serout or lcdout; i need a 16 bit binary to decimal conversion; i have to send a variable value to the Nokia 3310 display.
I now realized that DIG may be useful.
Regards
tenthousands = value / 10000
value = value - ( tenthousands * 10000 )
thousands = value / 1000
value = value - ( thousands * 1000 )
hundreds = value / 100
value = value - ( hundreds * 100 )
tens = value / 10
value = value - ( tens * 10 )
ones = value

string(4) = tenthousands + 48
string(3) = thousands + 48
string(2) = hundreds + 48
string(1) = tens + 48
string(0) = ones + 48

First chunk of code will get the decimal values for the place holder for that digit.

Second chunk of code will change that into an ASCII representation of that number.

Then you can just serout (or SPI or I2C or whatever) that 'string' out whatever port you need to...

Theoretically anyways...