Add some spike detection in temperature

master
James Gao 2014-11-30 11:22:31 -08:00
rodzic e873ee7601
commit efded28bfc
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -87,7 +87,7 @@ class Breakout(object):
time.sleep(.25)
temp = self.device.temperature
self.last = time.time()
if not isnan(temp):
if not isnan(temp) and abs(temp - self.history[-1]) < 10:
self.history.append(temp)
return self.temperature