Re: Voltage Ref Problem
'For global reference to system voltage, use the Voltage variable, which is based on a
'scale of 1 to 1000, with 775 = 7.75 volts. Remember that the resistors on the board
'divide the actual battery voltage in half so the ADC can "digest" it without damage.
'ADCIN voltages are limited to 5. Both EGT and Voltage are compared with the onboard
'precision voltage reference which delivers a perfect 5V.
'**Voltage**
LCDVLow=0
LCDVHigh=0
Voltage=0
ADCIN VoltChannel, Voltage 'Take just 1 voltage sample. 7.6V = 194
' SerOut LCDScreen, T9600, [LCDCmd, LCDLine1,"VoltsX=",#Voltage] 'RPM
' PAUSE 2000
Voltage = Voltage * 4 '194 * 4 = 776
LCDVHigh = Voltage / 100 '776 / 100 rounds to 7
LCDVLow = (Voltage // 100) / 10 '776 // 100 = 76, 76 / 10 = 7
LCDVLow = LCDVLow - 2
'Final Display = 7.7
My Hobbies is PicBasic PRO
Bookmarks