Hi
I am trying to read two voltages from two inputs. One reading is correct and the other is messed up.
Reading off B.4 is correct. I get ADC value 618 which translates to 3.02 volts
Reading off B.3 is wrong. The adc value is 468=2.28V. It should be zero, since I have that input grounded. I don't know where is this coming from. Error in the code below?
I am trying to read two voltages from two inputs. One reading is correct and the other is messed up.
Reading off B.4 is correct. I get ADC value 618 which translates to 3.02 volts
Reading off B.3 is wrong. The adc value is 468=2.28V. It should be zero, since I have that input grounded. I don't know where is this coming from. Error in the code below?
Code:
#Picaxe 18M2
#no_data
symbol Baud = T9600_8
SetFreq M8
High c.2
wait 1 ' wait for PICAXE LCD to boot
SerOut c.2, Baud, ("?G216")
wait 2
Do
SerOut c.2, Baud, ("?f") 'clear screen
ReadAdc10 B.4, w0
SerOut c.2, Baud, (#w0)
wait 1
w0 = w0 * 44 / 9
bintoascii w0,b2,b3,b4,b5,b6
SerOut c.2, Baud, ("?f")
pause 100
SerOut c.2, Baud,(" ",b3,".",b4,b5," volts ")
wait 2
w0 = 0
w1 = 0
ReadAdc10 B.3, w1
SerOut c.2, Baud, ("?f")
pause 100
SerOut c.2, Baud, (#w1)
wait 1
w1 = w1 * 44 / 9
bintoascii w1,b16,b17,b18,b19,b20
SerOut c.2, Baud, ("?f")
pause 100
SerOut c.2, Baud,(" ",b17,".",b18,b19," volts ")
wait 2
Loop