Add Support for OLED Rotate

This commit is contained in:
Michael Eckhoff
2018-10-30 09:30:41 -05:00
parent 66a37d7d25
commit f3c8f73ad9
6 changed files with 22 additions and 3 deletions

View File

@@ -169,11 +169,12 @@ const unsigned char logo_POCSAG_bmp [] =
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
COLED::COLED(unsigned char displayType, unsigned char displayBrightness, bool displayInvert, bool displayScroll, bool slot1Enabled, bool slot2Enabled) :
COLED::COLED(unsigned char displayType, unsigned char displayBrightness, bool displayInvert, bool displayScroll, bool displayRotate, bool slot1Enabled, bool slot2Enabled) :
m_displayType(displayType),
m_displayBrightness(displayBrightness),
m_displayInvert(displayInvert),
m_displayScroll(displayScroll),
m_displayRotate(displayRotate),
m_slot1Enabled(slot1Enabled),
m_slot2Enabled(slot2Enabled)
{
@@ -207,6 +208,11 @@ bool COLED::open()
if (m_displayBrightness > 0U)
display.setBrightness(m_displayBrightness);
if (m_displayRotate > 0U) {
display.sendCommand(0xC0);
display.sendCommand(0xA0);
}
// init done
display.clearDisplay(); // clears the screen buffer
display.display(); // display it (clear display)