
Originally Posted by
Bobbo_ZA
just not getting the decimal places now, :-(
Latest attempt
Code:
ADCIN 4, volt ' Read AN4 into temp variable
volt = volt * 2
Vin = (5*volt/1023)
Vind = (volt // 1000) / 10 'millivolts?
lcdout $FE, $C0+8, dec Vin,".",dec2 Vind,"V"
Time to pack it in for the night, work tomorrow, fairly good progress, just the decimal points to figure out.
Kind Regards
Rob
Ok Rob,
What about :
Code:
ADCIN 4, volt ' Read AN4 into temp variable
volt = volt * 2 * 5
Volt = 100*volt ' See manual for DIV32 !!!
Vind = DIV32 1024 ' Here we have result in 1/100 Volts ...
Vin = Vind/100 ' Here we get the integer part ...
Vind = Vind // 100 ' Here we get the decimal part ...
lcdout $FE, $C0+8, dec Vin,".",dec2 Vind,"V"
that's all !
Bookmarks