I wish to display the contents of a variable, probably an unsigned integer, on an lcd display driven from the 8051. I have written software to accept an array of characters and write these, so the ideal would be to creat a similat array from the variable. I have tried the basic ways I know of, sprintf (char_array, "%d", integer_value); (very low tech) but dosent work. Any pointers would be greatfully recieved, Thank you, Tim
Dan, Thank you very much for your help. Thats fantastic! Tim
If you are interested in a faster radix conversion, see here: http://www.programmersheaven.com/zone5/cat27/32144.htm A general purpose radix conversion function is provided as a specific example. The algorithm used is successive division of the value by the radix - same as algorithm posted by Dan. However, this implementation should prove to be much faster than using just C.