dabdibdira
New Member
Im doing a project with 8051. Im using Keil compiler. The output from the adc, usually in the range 0-255 must be converted to the range 0-14 for display. I use a simple mathematical relation "Display value= (adc value)/255*14". I want to send this float value, say, 12.5 through serial communication and display it in the serial window.
For display of integers, say 123, I approach the following way:
123/100=1 (first digit is sent through serial communication)
(123%100)/10=2 (second digit)
123%10=3 (third digit)
What logic will work out to display float numbers?
Its urgent. Someone help as soon as possible.
For display of integers, say 123, I approach the following way:
123/100=1 (first digit is sent through serial communication)
(123%100)/10=2 (second digit)
123%10=3 (third digit)
What logic will work out to display float numbers?
Its urgent. Someone help as soon as possible.