Browse Source

Do not report wrong temperature values for DS18B20

fastled
Xose Pérez 7 years ago
parent
commit
96e847f630
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      code/espurna/ds18b20.ino

+ 1
- 1
code/espurna/ds18b20.ino View File

@ -71,7 +71,7 @@ void dsLoop() {
double t = (tmpUnits == TMP_CELSIUS) ? ds18b20.getTempCByIndex(0) : ds18b20.getTempFByIndex(0); double t = (tmpUnits == TMP_CELSIUS) ? ds18b20.getTempCByIndex(0) : ds18b20.getTempFByIndex(0);
// Check if readings are valid // Check if readings are valid
if (isnan(t)) {
if (isnan(t) || t < -50) {
DEBUG_MSG_P(PSTR("[DS18B20] Error reading sensor\n")); DEBUG_MSG_P(PSTR("[DS18B20] Error reading sensor\n"));


Loading…
Cancel
Save