I have a little project where I need to read 0 - 30Vdc. I've used a 100K /10K divider to give a max of 3V into the ADC pin.
My Vref is 5.000V and I'm using a 10bit ADC.
5/1024 = 0.0048V per count
3V = 625
625x48 = 30000
How do I get a count of 625 to display as 30.00V?
This gives me a display of xx.xV not xx.xxVCode:ADCIN 1, LEDCOUNT LEDVOLT = LEDCOUNT * 48 LEDV0 = LEDVOLT/10 LEDV1 = LEDVOLT//10 PAUSE 200 LCDOUT $FE,1, "LED VOLTS ", DEC2 LEDV0, ".", DEC1 LEDV1, "V"
Bookmarks