- trying to filter thermocouple noise in software
This commit is contained in:
parent
ff1c38c91a
commit
3a89a6149f
10
lib/oven.py
10
lib/oven.py
@ -228,9 +228,17 @@ class TempSensorReal(TempSensor):
|
||||
def run(self):
|
||||
while True:
|
||||
try:
|
||||
self.temperature = self.thermocouple.get()
|
||||
temp1 = self.thermocouple.get()
|
||||
except Exception:
|
||||
log.exception("problem reading temp")
|
||||
try:
|
||||
temp2 = self.thermocouple.get()
|
||||
except Exception:
|
||||
log.exception("problem reading temp")
|
||||
if temp1 >= temp2:
|
||||
self.temperature = temp1
|
||||
else:
|
||||
self.temperature = temp2
|
||||
time.sleep(self.time_step)
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user