1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-23 21:01:25 +01:00

SH1106 OLED Display Offset Fix (#169)

Correct display offset for SH1106.  The SH1106 supports 132 columns but most displays use 128 column OLED, connected to the middle columns 2-129.
This commit is contained in:
Neil McKechnie 2021-06-10 16:24:44 +01:00 committed by GitHub
parent ac37228942
commit 79763a3bb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -74,8 +74,8 @@ void SSD1306AsciiWire::setCursor(uint8_t col, uint8_t row) {
m_col = col + m_colOffset;
I2CManager.write(m_i2cAddr, 4,
0x00, // Set to command mode
SSD1306_SETLOWCOLUMN | (col & 0XF),
SSD1306_SETHIGHCOLUMN | (col >> 4),
SSD1306_SETLOWCOLUMN | (m_col & 0XF),
SSD1306_SETHIGHCOLUMN | (m_col >> 4),
SSD1306_SETSTARTPAGE | m_row);
}
}

View File

@ -182,6 +182,7 @@ static const uint8_t MEM_TYPE SH1106_128x64init[] = {
0x00, // Set to command mode
SSD1306_DISPLAYOFF,
SSD1306_SETSTARTPAGE | 0X0, // set page address
SSD1306_SETSTARTLINE | 0x0, // set start line
SSD1306_SETCONTRAST, 0x80, // 128
SSD1306_SEGREMAP | 0X1, // set segment remap
SSD1306_NORMALDISPLAY, // normal / reverse