mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-19 11:42:09 +02:00
Added support clearing display at 0 brightness for DIY Boards to AgOledDisplay.
Currently, the only affect the brightness setting has with the DIY boards is an attempt to set the contrast. Setting the contrast to 0 does not have any effect. This appears to be a know limitation for these display boards.
This commit is contained in:
@ -424,7 +424,17 @@ void OledDisplay::setBrightness(int percent) {
|
||||
DISP()->setContrast((127 * percent) / 100);
|
||||
}
|
||||
} else if (ag->isBasic()) {
|
||||
ag->display.setContrast((255 * percent) / 100);
|
||||
if (percent == 0) {
|
||||
isDisplayOff = true;
|
||||
|
||||
// Clear display.
|
||||
ag->display.clear();
|
||||
ag->display.show();
|
||||
}
|
||||
else {
|
||||
isDisplayOff = false;
|
||||
ag->display.setContrast((255 * percent) / 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user