forked from airgradienthq/arduino
Implement display / ledBar brightness
This commit is contained in:
@@ -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