Moderators: adafruit_support_bill, adafruit
void loop () {
unsigned long startTime = millis();
unsigned int temperature = readTheTemperature();
if ( thisTempNeedsChanging( temperature ) ) {
adjustTheVentsFor( temperature );
}
unisgned int humidity = readTheHumidity();
if ( thisHumidityNeedsChanging( humidity ) ) {
adjustTheIrrigationFor( humidity );
}
unsigned long currentTime = millis();
/* make each pass through the loop about 5 min long */
while ( 300000 > (currentTime - startTime) ) {
delay (1000);
currentTime = millis();
}
}
Users browsing this forum: No registered users and 12 guests