From a3cf5bfe8b32f9d8808f2eaa13818b680d6026f2 Mon Sep 17 00:00:00 2001 From: Ollo Date: Sat, 31 Oct 2020 00:10:00 +0100 Subject: [PATCH] Less temperature debugging output --- esp32/src/main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index d7c828f..78bb2d2 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -340,16 +340,16 @@ void readSensors() { float temp[2] = {0, 0}; float* pFloat = temp; for(int i=0; i < 10; i++) { - // first read returns crap, ignore result and read twice if (dallas.readAllTemperatures(pFloat, 2) > 0) { - Serial << "t1: " << String(temp[0]) << endl; - Serial << "t2: " << String(temp[1]) << endl; + Serial << "t1: " << String(temp[0]) << endl; + Serial << "t2: " << String(temp[1]) << endl; + // first read returns crap, ignore result and read again + if (i <= 2) { + temp1.add(temp[0]); + temp2.add(temp[1]); + } } delay(200); - if (i <= 2) { - temp1.add(temp[0]); - temp2.add(temp[1]); - } } /* Use the Ultrasonic sensor to measure waterLevel */