From 2be65a0b764619628f74e6d77c5022512f1f889b Mon Sep 17 00:00:00 2001 From: Erick Ahmed Date: Wed, 29 Oct 2025 14:45:22 +0100 Subject: [PATCH] Implement plant watering based on current moisture levels --- firmware/atmega/source/main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/firmware/atmega/source/main.c b/firmware/atmega/source/main.c index c58b7a1..b1bc50e 100644 --- a/firmware/atmega/source/main.c +++ b/firmware/atmega/source/main.c @@ -45,12 +45,10 @@ int main(void) { pLastMoistureVal = &lastMoistureVal; while(true) { - *pLastMoistureVal = moistureRead(); - // nested if: (result outside range (see config.h)) {waterPlant()} - + if ((*pLastMoistureVal = moistureRead()) < MOISTURE_MIN) waterPlant(); twiRespond(); - enterSleep(); } + return -1; }