Hi this is what i do to show the Temperature from a Sensor on AI # 1 will show you the decimal point from 0 to 9 at real time, try it and see if it work.Simply Multiply it by 1000
lets say that the sensor is from 30?F to 250?F ;4-20ma
4ma/30?F = 814Cnt and 20ma/250?F = 4073 Cnt that's with a Resistor of 249 ohms 0.01%
If ADC(1) = 814 it give you a value of 299 wich we convert to 29.9 as String Data Type and a Count of 4073 is a value of 2500 wich is 250.0
Code:
T = (ADC(1) * 2000) / 4073
A = ((T - 400) * 2200) /1600 + 300 'Temperature scale of 1000
IF LEN(STR$(A)) <= 3 THEN
A$ = "RM TEMP: " + MID$(STR$(A),1,LEN(STR$(A))-1)+"."+ MID$(STR$(A),LEN(STR$(A)),1)
ENDIF
IF LEN(STR$(A)) >= 4 THEN
A$ = "RM TEMP: " + MID$(STR$(A),1,LEN(STR$(A))-1)+"."+ MID$(STR$(A),LEN(STR$(A)),1)
ENDIF
SETLCD 1,1, A$ + CHR$(176)+"F" 'Show it on the display like 75.3 ?F
Find the maximum and minimum Count of the sensor and change the Equation...
I hope that helps too