Browse Source

AP_Notify: add mah consumed to BAT line in OLED displays

zr-v5.1
Henry Wurzburg 5 years ago committed by Andrew Tridgell
parent
commit
bf1b48b940
  1. 4
      libraries/AP_Notify/Display.cpp
  2. BIN
      libraries/AP_OSD/fonts/font4.bin

4
libraries/AP_Notify/Display.cpp

@ -524,7 +524,9 @@ void Display::update_ekf(uint8_t r) @@ -524,7 +524,9 @@ void Display::update_ekf(uint8_t r)
void Display::update_battery(uint8_t r)
{
char msg [DISPLAY_MESSAGE_SIZE];
snprintf(msg, DISPLAY_MESSAGE_SIZE, "BAT1: %4.2fV", (double)AP::battery().voltage()) ;
AP_BattMonitor &battery = AP::battery();
uint8_t pct = battery.capacity_remaining_pct();
snprintf(msg, DISPLAY_MESSAGE_SIZE, "BAT:%4.2fV %2d%% ", (double)battery.voltage(), pct) ;
draw_text(COLUMN(0), ROW(r), msg);
}

BIN
libraries/AP_OSD/fonts/font4.bin

Binary file not shown.
Loading…
Cancel
Save