forked from airgradienthq/arduino
Implement display / ledBar brightness
This commit is contained in:
1 parent
d40b1d37a8
commit
f08438db46
6 files changed
+110
-2
No files matched your search
@@ -94,6 +94,8 @@ bool OledDisplay::begin(void) {
|
||||
return false;
|
||||
}
|
||||
|
||||
setBrightness(config.getDisplayBrightness());
|
||||
|
||||
isBegin = true;
|
||||
logInfo("begin");
|
||||
return true;
|
||||
@@ -308,3 +310,7 @@ void OledDisplay::showWiFiQrCode(String content, String label) {
|
||||
DISP()->drawStr(x_start, 60, label.c_str());
|
||||
} while (DISP()->nextPage());
|
||||
}
|
||||
|
||||
void OledDisplay::setBrightness(int percent) {
|
||||
DISP()->setContrast((127 * percent) / 100);
|
||||
}
|
||||
Reference in new issue
Block a user