Browse Source

Use ArduinoLowPower to send the MCU to deep sleep between readings

Helmut Pozimski 3 years ago
parent
commit
46baf0a8b4
1 changed files with 2 additions and 1 deletions
  1. 2 1
      feather-room-climate-sensor.ino

+ 2 - 1
feather-room-climate-sensor.ino

@@ -1,6 +1,7 @@
 
 #include "Adafruit_CCS811.h"
 #include "Adafruit_Si7021.h"
+#include "ArduinoLowPower.h"
 
 #define VBATPIN A7
 
@@ -42,8 +43,8 @@ void loop() {
     readEco2(), temperature_sensor.readHumidity(), 
     temperature_sensor.readTemperature(), readTVOC(),
     readBatteryPercentage());
-  delay(60000);
 
+  LowPower.sleep(300000);
 }
 
 uint16_t readEco2() {