Implement plant watering based on current moisture levels
This commit is contained in:
@@ -45,12 +45,10 @@ int main(void) {
|
|||||||
pLastMoistureVal = &lastMoistureVal;
|
pLastMoistureVal = &lastMoistureVal;
|
||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
*pLastMoistureVal = moistureRead();
|
if ((*pLastMoistureVal = moistureRead()) < MOISTURE_MIN) waterPlant();
|
||||||
// nested if: (result outside range (see config.h)) {waterPlant()}
|
|
||||||
|
|
||||||
twiRespond();
|
twiRespond();
|
||||||
|
|
||||||
enterSleep();
|
enterSleep();
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user