runtime optimization

This commit is contained in:
Ollo
2021-04-07 22:18:52 +02:00
parent 31229594fe
commit 0a1d755154
2 changed files with 6 additions and 5 deletions

View File

@@ -242,7 +242,7 @@ void readSensors()
{
mPlants[i].addSenseValue();
}
delay(10);
delay(2);
}
/* Read the distance and give the temperature sensors some time */
@@ -559,9 +559,12 @@ void plantcontrol()
if (lastPumpRunning != -1)
{
//long waterDiff = waterRawSensor.getAverage() - lastWaterValue;
//TODO attribute used water in ml to plantid
long waterDiff = waterRawSensor.getAverage() - lastWaterValue;
mPlants[lastPumpRunning].setProperty("waterusage").send(String(waterDiff));
/* TODO convert diff into volume (milli liter) */
Serial << "Plant" << lastPumpRunning << ": Water diff " << waterDiff << " mm" << endl;
}
for (int i = 0; i < MAX_PLANTS; i++)
{
long raw = mPlants[i].getCurrentMoisture();