Update main logic flow and fix bug that did not let MCU sleep
This commit is contained in:
+7
-4
@@ -30,10 +30,13 @@ void setup(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void loop(void) {
|
void loop(void) {
|
||||||
triggerSensorRead();
|
if (readSensors) {
|
||||||
int16_t result = readMoisture();
|
int16_t result = readMoisture();
|
||||||
if (result != -1) {
|
if (result != -1) {
|
||||||
|
Serial.println(result);
|
||||||
|
readSensors = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enterSleep();
|
enterSleep();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user