diff --git a/esp32/include/PlantCtrl.h b/esp32/include/PlantCtrl.h index a98b65b..1946cf4 100644 --- a/esp32/include/PlantCtrl.h +++ b/esp32/include/PlantCtrl.h @@ -82,6 +82,9 @@ public: float getCurrentMoisture() { + if(mMoisture_freq < MOIST_SENSOR_MIN_FRQ){ + return MISSING_SENSOR; + } return mMoisture_freq; } diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index 147c6e1..8cfcc76 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -273,6 +273,11 @@ void readPowerSwitchedSensors() mPlants[i].stopMoistureMeasurement(); } + for (int i = 0; i < MAX_PLANTS; i++) + { + Serial << "Plant " << i << " measurement: " << mPlants[i].getCurrentMoisture() << " hz" << endl; + } + waterRawSensor.clear(); Wire.setPins(SENSOR_TANK_TRG, SENSOR_TANK_ECHO); Wire.begin();