kopia lustrzana https://github.com/jbruce12000/kiln-controller
KILN-008 - handle read errors for mcp9600
rodzic
6b8aa6e170
commit
2c55a6c0ed
|
@ -39,13 +39,17 @@ class OvenMCP9600(object):
|
|||
|
||||
def read(self):
|
||||
'''Reads temperature from thermocouple and code junction'''
|
||||
# Save data
|
||||
self.tempC = self.mcp.temperature
|
||||
self.referenceTempC = self.mcp.ambient_temperature
|
||||
try:
|
||||
# Save data
|
||||
self.tempC = self.mcp.temperature
|
||||
self.referenceTempC = self.mcp.ambient_temperature
|
||||
self.noConnection = False
|
||||
except:
|
||||
self.noConnection = True
|
||||
|
||||
def checkErrors(self, data_32 = None):
|
||||
'''Checks error bits to see if there are any SCV, SCG, or OC faults'''
|
||||
self.noConnection = self.shortToGround = self.shortToVCC = self.unknownError = False
|
||||
self.shortToGround = self.shortToVCC = self.unknownError = False
|
||||
|
||||
def data_to_rj_temperature(self, data_32 = None):
|
||||
'''Returns reference junction temperature in C.'''
|
||||
|
|
Ładowanie…
Reference in New Issue