- refactored temperature correction
This commit is contained in:
@@ -39,7 +39,7 @@ class TempSensor_max31865(ATemperatureSensor):
|
|||||||
return self.digits
|
return self.digits
|
||||||
|
|
||||||
def temperature(self):
|
def temperature(self):
|
||||||
return self.__tempRaw()
|
return self.__tempRaw() + self.temp_correction
|
||||||
|
|
||||||
def __tempRaw(self):
|
def __tempRaw(self):
|
||||||
try:
|
try:
|
||||||
@@ -47,7 +47,7 @@ class TempSensor_max31865(ATemperatureSensor):
|
|||||||
except:
|
except:
|
||||||
return None
|
return None
|
||||||
R = TempSensor_max31865.calc_R(430, digits)
|
R = TempSensor_max31865.calc_R(430, digits)
|
||||||
T = TempSensor_max31865.vanDusen_temp(R) + self.temp_correction
|
T = TempSensor_max31865.vanDusen_temp(R)
|
||||||
print("Digits={}, R={:.3f} Ohm, T={:.2f} degC".format(digits, R, T))
|
print("Digits={}, R={:.3f} Ohm, T={:.2f} degC".format(digits, R, T))
|
||||||
return T
|
return T
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user