Function GetTherm(Chan As Byte) As Single
' t = (-273,15 + A + B Ln(RNTC) + C * (Ln(RNTC)^3)^-1 ==> t in Celcius
Dim Vntc As Integer
Dim Rntc As Long
Dim LgR As Single
Dim Therm As Single
Dim A As Single
Dim B As Single
Dim C As Single
A = 0.001129241
B = 0.0002341077
C = 0.00000008775468
Vntc=Tadin(1)
Vntc=Vntc * 5000/1024 ' Voltage drop across thermistor
Rntc=10000 * Vntc/(5000-Vntc) ' Thermistor Resistance
LgR=Log(Rntc)
Therm = C * (LgR^3)
Therm = Therm + A + (B * LgR)
Therm = 1/Therm 'Kelvin
Therm = Therm - 273.15 'Celsius
Therm= (Therm * 9/5) + 32 'Farenheit
GetTherm = Therm
End Function