battery status display

This commit is contained in:
Klaus K Wilting 2018-07-21 21:50:39 +02:00
parent daba1678a4
commit fc0bd1f542
2 changed files with 12 additions and 6 deletions

View File

@ -13,10 +13,10 @@
[platformio] [platformio]
;env_default = lolin32lite, heltec, generic ;env_default = lolin32lite, heltec, generic
;env_default = generic ;env_default = generic
env_default = heltec ;env_default = heltec
;env_default = ttgov1 ;env_default = ttgov1
;env_default = ttgov2 ;env_default = ttgov2
;env_default = ttgov21 env_default = ttgov21
;env_default = ttgobeam ;env_default = ttgobeam
;env_default = lopy ;env_default = lopy
;env_default = lopy4 ;env_default = lopy4

View File

@ -109,16 +109,22 @@ void refreshDisplay() {
u8x8.draw2x2String(0, 0, u8x8.draw2x2String(0, 0,
buff); // display number on unique macs total Wifi + BLE buff); // display number on unique macs total Wifi + BLE
// update GPS status (line 2) // update Battery status (line 2)
#ifdef HAS_BATTERY_PROBE
u8x8.setCursor(0, 2);
u8x8.printf("B=%.1fV", read_voltage() / 1000.0);
#endif
// update GPS status (line 2)
#ifdef HAS_GPS #ifdef HAS_GPS
u8x8.setCursor(7, 2); u8x8.setCursor(8, 2);
if (!gps.location.isValid()) // if no fix then display Sats value inverse if (!gps.location.isValid()) // if no fix then display Sats value inverse
{ {
u8x8.setInverseFont(1); u8x8.setInverseFont(1);
u8x8.printf("Sats: %.3d", gps.satellites.value()); u8x8.printf("Sat %.3d", gps.satellites.value());
u8x8.setInverseFont(0); u8x8.setInverseFont(0);
} else } else
u8x8.printf("Sats: %.3d", gps.satellites.value()); u8x8.printf("Sat %.3d", gps.satellites.value());
#endif #endif
// update bluetooth counter + LoRa SF (line 3) // update bluetooth counter + LoRa SF (line 3)