Take different screen widths into account for brightness bar

width of sh1106 display is 132 for example
1.2-legacy
Marcel van der Boom 2020-06-25 16:20:49 +02:00
rodzic 13806cce93
commit a6c6b45576
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -740,8 +740,8 @@ void Screen::adjustBrightness(){
} else {
brightness++;
}
int width = brightness / 1.984375;
dispdev.drawRect( 0, 30, 128, 4);
int width = (brightness / 254) * SCREEN_WIDTH;
dispdev.drawRect( 0, 30, SCREEN_WIDTH, 4);
dispdev.fillRect(0, 30, width, 4);
dispdev.display();
dispdev.setBrightness(brightness);