
Originally Posted by
Darrel Taylor
If you go with 2 decimals, you may want to use 10-bit values from the A/D for better accuracy.
In which case you would Right Justify, and the math changes to...<pre>1023 * 5 / 1023 = 5 ; Single digit<br>1023 * 50 / 1023 = 50 ; 1 decimal place<br>1023 * 500 / 1023 = 500 ; 2 decimals</pre>But you'll need to use DIV32 for those.
I want to use 10-bit values.
But i can use the DIV32 command to show the result on LCD.
Now for 8 bit i have this code:
Code:
ADCIN 0, adval ' Read channel 0 to adval
value = adval*50/255 ' 1 decimal place (5.0)
LCDOUT $FE,1,"VOLT : ",DEC value/10, ".",DEC value//10, " V"
Bookmarks