How to convert ADC input for floating point display?
Hello.
I'm doing a simple ADC reading circuit, which works fine, and I read the value into variable, but want to display it as floating point voltage, not the decimal. Since floating point operations not supported, I'm getting output "4" where I should get "4.1". Is there a way to add some dots?
Currently, I've configured it such way, that when voltage is 4.88v, the variable value is 488. So I need to somehow place point between 4 and 88, so it looks like "4.88"
Re: How to convert ADC input for floating point display?
Voltage=488
LCDOUT $FE, $1, #(Voltage DIG 2), ".", DEC2 Voltage
Re: How to convert ADC input for floating point display?
Thank you very much, it works!
Re: How to convert ADC input for floating point display?
Or possibly
Code:
LCDOUT $FE, $1, DEC (Voltage/100), ".", DEC (Voltage // 100)
It produces slightly smaller code.
/Henrik.