Fixed plant loop in mode1

This commit is contained in:
Ollo 2020-11-01 13:26:38 +01:00
parent 902b81ab3e
commit 6ba2f92fa7

View File

@ -550,16 +550,16 @@ bool mode1(){
Serial.println("1 missing rtc value, going to mode2"); Serial.println("1 missing rtc value, going to mode2");
return true; return true;
} }
for(int i = 0;i<6;i++){ for(int i = 0; i < MAX_PLANTS; i++){
long trigger =getMoistureTrigger(i); long trigger =getMoistureTrigger(i);
if(trigger == 0){ if (trigger == 0) {
Serial << "Missing rtc trigger " << i << endl; Serial << "Missing rtc trigger " << i << endl;
return true; return true;
} }
if(trigger == DEACTIVATED_PLANT){ if(trigger == DEACTIVATED_PLANT){
continue; continue;
} }
if(mPlants[0].getSensorValue() <= trigger){ if(mPlants[i].getSensorValue() <= trigger){
Serial << "plant dry starting mode 2" << i << endl; Serial << "plant dry starting mode 2" << i << endl;
return true; return true;
} }