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...
Bookmarks