AP_Notify: add mah consumed to BAT line in OLED displays

This commit is contained in:
Henry Wurzburg 2020-01-29 22:54:28 -06:00 committed by Andrew Tridgell
parent 7f64c6159d
commit bf1b48b940
2 changed files with 3 additions and 1 deletions

View File

@ -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);
}

Binary file not shown.