Hi All
I am using a 24V battery and its connected to a PiCAXE 14M2. The battery powers a PCB via a LM7815 AND LM7805 and so I get 5V into the PICAXE. I have also created a voltage divider with R1 22K AND R2 2.2K at 26.5V on the battery I get 2.4V out of my VD and this is then connected to c.0 on the 14M2. I have a LCD connected to pin b.1.
The results aren't as expected and I am struggling to see why. I do know that the voltage measured at the pin is 2.4V when the battery is at 26.5 Any help would be appreciated as all I get is 2.00V displayed and I cant figure out where I am loosing the .4V in the maths.
The code is
Its probably simple, like me!
Thanks for your help.
I am using a 24V battery and its connected to a PiCAXE 14M2. The battery powers a PCB via a LM7815 AND LM7805 and so I get 5V into the PICAXE. I have also created a voltage divider with R1 22K AND R2 2.2K at 26.5V on the battery I get 2.4V out of my VD and this is then connected to c.0 on the 14M2. I have a LCD connected to pin b.1.
The results aren't as expected and I am struggling to see why. I do know that the voltage measured at the pin is 2.4V when the battery is at 26.5 Any help would be appreciated as all I get is 2.00V displayed and I cant figure out where I am loosing the .4V in the maths.
The code is
Code:
readadc10 c.0,adcvalu
sourcev=adcvalu*10
touchpad=sourcev/2046*100
bintoascii touchpad, b20, b19, b18, b17, b16
serout B.1,n2400,("BATT VOLTS:", b20,b19,b18,".", b17, b16)
Thanks for your help.