This commit is contained in:
2020-12-20 17:00:44 +01:00
parent e7ac4210c1
commit 23beebc4be
4 changed files with 5 additions and 159 deletions

View File

@@ -19,6 +19,7 @@ Plant::Plant(int pinSensor, int pinPump, int plantId, HomieNode *plant, PlantSet
this->mPinPump = pinPump;
this->mPlant = plant;
this->mSetting = setting;
this->mPlantId = plantId;
}
void Plant::init(void)
@@ -53,6 +54,9 @@ void Plant::addSenseValue(void)
int raw = analogRead(this->mPinSensor);
if(raw < MOIST_SENSOR_MAX_ADC && raw > MOIST_SENSOR_MIN_ADC){
this->moistureRaw.add(raw);
} else {
int plantId = this->mPlantId;
Serial << "ignoring sensor " << plantId << " value due to being strange " << raw << endl;
}
}