Fixed display bar.

pull/32/head
Holger Wirtz 4 years ago
parent 9b9aa4540a
commit a75494b7fa
  1. 6
      UI.hpp

@ -4530,15 +4530,17 @@ void lcd_display_bar_float(const char* title, float value, float factor, int32_t
if (vi == 0)
{
lcd.write((uint8_t)vf / 2.0 - 0.5);
lcd.print(F(" "));
for (uint8_t i = vi + 1; i < LCD_cols; i++)
lcd.print(F(" ")); // empty block
}
else
{
for (uint8_t i = 0; i < vi; i++)
lcd.write((uint8_t)4); // full block
if (vi < LCD_cols)
lcd.write((uint8_t)vf / 2.0 - 0.5);
for (uint8_t i = LCD_cols - vi; i < LCD_cols; i++)
for (uint8_t i = vi + 1; i < LCD_cols; i++)
lcd.print(F(" ")); // empty block
}
}

Loading…
Cancel
Save