MCPcopy Create free account
hub / github.com/PricelessToolkit/MailBoxGuard / setContrast

Method setContrast

Code/Arduino_libraries/SSD1306/OLEDDisplay.cpp:773–783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

771}
772
773void OLEDDisplay::setContrast(uint8_t contrast, uint8_t precharge, uint8_t comdetect) {
774 sendCommand(SETPRECHARGE); //0xD9
775 sendCommand(precharge); //0xF1 default, to lower the contrast, put 1-1F
776 sendCommand(SETCONTRAST);
777 sendCommand(contrast); // 0-255
778 sendCommand(SETVCOMDETECT); //0xDB, (additionally needed to lower the contrast)
779 sendCommand(comdetect); //0x40 default, to lower the contrast, put 0
780 sendCommand(DISPLAYALLON_RESUME);
781 sendCommand(NORMALDISPLAY);
782 sendCommand(DISPLAYON);
783}
784
785void OLEDDisplay::setBrightness(uint8_t brightness) {
786 uint8_t contrast = brightness;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected