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) {
|
||||
triggerSensorRead();
|
||||
int16_t result = readMoisture();
|
||||
if (result != -1) {
|
||||
|
||||
if (readSensors) {
|
||||
int16_t result = readMoisture();
|
||||
if (result != -1) {
|
||||
Serial.println(result);
|
||||
readSensors = false;
|
||||
}
|
||||
}
|
||||
|
||||
enterSleep();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user