Skip to content

Commit 8c1b4ca

Browse files
committed
Set brightness based on a scale 0-100
1 parent 70afdfc commit 8c1b4ca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ESPGeiger/src/OLEDDisplay/OLEDDisplay.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,18 @@ class SSD1306Display : public SSD1306Wire{
8080
void clear() {
8181
SSD1306Wire::clear();
8282
}
83+
8384
void clear(int start, int end) {
8485
setColor(BLACK);
8586
fillRect(0, (start+1)*fontHeight, OLED_WIDTH, (end-start+1)*fontHeight);
8687
setColor(WHITE);
8788
}
8889

90+
void setBrightness(uint8_t brightness) {
91+
brightness = (int)brightness * 2.55;
92+
SSD1306Wire::setBrightness(brightness);
93+
}
94+
8995
uint8_t type() { return 1; }
9096
void noBlink() {/*no support*/}
9197
void blink() {/*no support*/}

0 commit comments

Comments
 (0)