diff --git a/src/atmega/main.cpp b/src/atmega/main.cpp index 518d6de..dc9fd2f 100644 --- a/src/atmega/main.cpp +++ b/src/atmega/main.cpp @@ -31,14 +31,16 @@ void setup(void) { watchdogs(); } -void loop(void) { - if (readSensors) { - int16_t result = readMoisture(); - if (result != -1) { - Serial.println(result); - readSensors = false; +int main(void) { + while(true) { + if (readSensors) { + int16_t result = readMoisture(); + if (result != -1) { + Serial.println(result); + readSensors = false; + } } + enterSleep(); } - - enterSleep(); + return 0; }