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

@ -76,7 +76,5 @@ DS18B20 one wire temp sensor
## Masterplan 2.0 ## Masterplan 2.0
* Partitionslayout * Partitionslayout
* OW-search address in topic nutzen
* Wifi bei timout deaktivieren (damit wir entweder wlan spielen oder fallback: nur pflanzen giessen)

View File

@ -242,7 +242,7 @@ void readSensors()
{ {
mPlants[i].addSenseValue(); mPlants[i].addSenseValue();
} }
delay(10); delay(2);
} }
/* Read the distance and give the temperature sensors some time */ /* Read the distance and give the temperature sensors some time */
@ -559,9 +559,12 @@ void plantcontrol()
if (lastPumpRunning != -1) if (lastPumpRunning != -1)
{ {
//long waterDiff = waterRawSensor.getAverage() - lastWaterValue; long waterDiff = waterRawSensor.getAverage() - lastWaterValue;
//TODO attribute used water in ml to plantid 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++) for (int i = 0; i < MAX_PLANTS; i++)
{ {
long raw = mPlants[i].getCurrentMoisture(); long raw = mPlants[i].getCurrentMoisture();