41 uint32_t SLEEP_TIME = 900000;
42 int oldBatteryPcnt = 0;
43 #define FULL_BATTERY 3 // 3V for 2xAA alkaline. Adjust if you use a different battery setup.
59 int batteryPcnt = batteryMillivolts / FULL_BATTERY / 1000.0 * 100 + 0.5;
61 Serial.print(
"Battery voltage: ");
62 Serial.print(batteryMillivolts / 1000.0);
64 Serial.print(
"Battery percent: ");
65 Serial.print(batteryPcnt);
69 if (oldBatteryPcnt != batteryPcnt) {
71 oldBatteryPcnt = batteryPcnt;