mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-23 12:51:24 +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:
parent
ac37228942
commit
79763a3bb8
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user