Skip to content

Commit 2ec3cae

Browse files
authored
Remove sendCommand(NORMALDISPLAY) from setContrast() (#427)
Refactor setContrast and setBrightness methods to remove forceNormal parameter and preserve display mode state
1 parent 70921e5 commit 2ec3cae

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ void normalDisplay(void);
171171
// normal brightness & contrast: contrast = 100
172172
void setContrast(uint8_t contrast, uint8_t precharge = 241, uint8_t comdetect = 64);
173173

174-
// Convenience method to access
174+
// Convenience method to access setContrast with only brightness parameter
175175
void setBrightness(uint8_t);
176176

177177
// Turn the display upside down

src/OLEDDisplay.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,6 @@ void OLEDDisplay::setContrast(uint8_t contrast, uint8_t precharge, uint8_t comde
784784
sendCommand(SETVCOMDETECT); //0xDB, (additionally needed to lower the contrast)
785785
sendCommand(comdetect); //0x40 default, to lower the contrast, put 0
786786
sendCommand(DISPLAYALLON_RESUME);
787-
sendCommand(NORMALDISPLAY);
788787
sendCommand(DISPLAYON);
789788
}
790789

src/OLEDDisplay.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ class OLEDDisplay : public Stream {
296296
// normal brightness & contrast: contrast = 100
297297
void setContrast(uint8_t contrast, uint8_t precharge = 241, uint8_t comdetect = 64);
298298

299-
// Convenience method to access
299+
// Convenience method to access setContrast with only brightness parameter
300300
void setBrightness(uint8_t);
301301

302302
// Reset display rotation or mirroring

0 commit comments

Comments
 (0)