From 6ba2f92fa73e8b007c397f57cc292e565f40a62e Mon Sep 17 00:00:00 2001 From: Ollo Date: Sun, 1 Nov 2020 13:26:38 +0100 Subject: [PATCH] Fixed plant loop in mode1 --- esp32/src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index 6c803b6..1168e4d 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -550,16 +550,16 @@ bool mode1(){ Serial.println("1 missing rtc value, going to mode2"); return true; } - for(int i = 0;i<6;i++){ + for(int i = 0; i < MAX_PLANTS; i++){ long trigger =getMoistureTrigger(i); - if(trigger == 0){ + if (trigger == 0) { Serial << "Missing rtc trigger " << i << endl; return true; } if(trigger == DEACTIVATED_PLANT){ continue; } - if(mPlants[0].getSensorValue() <= trigger){ + if(mPlants[i].getSensorValue() <= trigger){ Serial << "plant dry starting mode 2" << i << endl; return true; }