mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-20 20:22:08 +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,8 +424,18 @@ void OledDisplay::setBrightness(int percent) {
|
|||||||
DISP()->setContrast((127 * percent) / 100);
|
DISP()->setContrast((127 * percent) / 100);
|
||||||
}
|
}
|
||||||
} else if (ag->isBasic()) {
|
} else if (ag->isBasic()) {
|
||||||
|
if (percent == 0) {
|
||||||
|
isDisplayOff = true;
|
||||||
|
|
||||||
|
// Clear display.
|
||||||
|
ag->display.clear();
|
||||||
|
ag->display.show();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
isDisplayOff = false;
|
||||||
ag->display.setContrast((255 * percent) / 100);
|
ag->display.setContrast((255 * percent) / 100);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
|
Reference in New Issue
Block a user