diff --git a/aqi.ino b/aqi.ino index 570faaf..829ce36 100644 --- a/aqi.ino +++ b/aqi.ino @@ -59,6 +59,7 @@ struct { unsigned long on_off_btn = 0; unsigned long update_lcd = 0; unsigned long sen44 = 0; + unsigned long cleaning = 0; } parallel; // Force write data to screen. @@ -164,6 +165,12 @@ void loop(void) sen44_mes.temp = celsius_to_fahrenheit(sen44_mes.temp); sen44_mes.f_temp = heat_index(sen44_mes.temp, sen44_mes.hum); } + + // "Parallel" execution for triggering cleaning in Sen44 after 2 days. + if (millis() - parallel.cleaning >= 172800000) { + parallel.cleaning = millis(); + sen44.startFanCleaning(); + } } // Write data to screen.