Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatability with SH1106 #36

Open
bridge2nowhere opened this issue Apr 24, 2018 · 4 comments
Open

Compatability with SH1106 #36

bridge2nowhere opened this issue Apr 24, 2018 · 4 comments

Comments

@bridge2nowhere
Copy link

I was wondering if I could have help getting a version of this library that is compatible with the SH1106 driver which is 132 pixels wide, and causes the display to be cut off on the left side.

@greiman
Copy link
Owner

greiman commented Apr 24, 2018

See the examples HelloWorldSH1106Spi or Spi128x64SH1106.

See the SDD1306init.h file in this section for SH1106 init commands. You scan edit it for your display.

//------------------------------------------------------------------------------
// This section is based on https://github.com/stanleyhuangyc/MultiLCD
/** Initialization commands for a 128x64 SH1106 oled display. */
static const uint8_t MEM_TYPE SH1106_128x64init[] = {
  SSD1306_DISPLAYOFF,
  SSD1306_SETSTARTPAGE | 0X0,            // set page address
  SSD1306_SETCONTRAST, 0x80,             // 128
  SSD1306_SEGREMAP | 0X1,                // set segment remap
  SSD1306_NORMALDISPLAY,                 // normal / reverse
  SSD1306_SETMULTIPLEX, 0x3F,            // ratio 64
  SH1106_SET_PUMP_MODE, SH1106_PUMP_ON,  // set charge pump enable
  SH1106_SET_PUMP_VOLTAGE | 0X2,         // 8.0 volts
  SSD1306_COMSCANDEC,                    // Com scan direction
  SSD1306_SETDISPLAYOFFSET, 0X00,        // set display offset
  SSD1306_SETDISPLAYCLOCKDIV, 0X80,      // set osc division
  SSD1306_SETPRECHARGE, 0X1F,            // set pre-charge period
  SSD1306_SETCOMPINS, 0X12,              // set COM pins
  SSD1306_SETVCOMDETECT,  0x40,          // set vcomh
  SSD1306_DISPLAYON
};
/** Initialize a 128x64 oled SH1106 display. */
static const DevType MEM_TYPE SH1106_128x64 =  {
  SH1106_128x64init, 
  sizeof(SH1106_128x64init),
  128,
  64,
  2    // SH1106 is a 132x64 controller.  Use middle 128 columns.
};

@bridge2nowhere
Copy link
Author

Great, thank you, I'm sorry I missed the examples.

@bgrigoriu
Copy link

Hi,

I am using an SH1106 on I2C and it displays text ok BUT all the text is shifted to the left with two pixels.
As I am still a newbie could you please advice how to fix it or at least where to dig for ?
Thank you in advance

@bgrigoriu
Copy link

Sory for the question !

Found the answer in another post

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants