Microcontroller › PIC › Convert ‘ unsigned long int ‘ to ‘string’ without using inbuilt function for UART › You are welcome, Sorry, I
January 7, 2015 at 10:34 pm
#12501
Participant
You are welcome,
Sorry, I also made a mistake accidentally in prevoius post (divide instead of moduo), but you made it correct.
You can do the same thing with float values, but before converting to ascii simply multiply float value in order to lose decimal places and print it via uart digit by digit.
Example:
If you want to print float value 32.768 , multiply it by 1000 (or some other factor depending on decimal places you want to show) to get integer 32768 and print it digit by digit as in previous case.