SSD1306Ascii icon indicating copy to clipboard operation
SSD1306Ascii copied to clipboard

When using a display with more than 64 pixels in the Y direction, the lcdHeight parameter is ignored.

Open jonathanmlang opened this issue 2 years ago • 6 comments

In SSD1306Ascii.cpp there is an issue that prevents displays with more than 8 rows or 64 pixels from displaying more than that. The issue seems to be at line 166 in that file.

I have changed: ssd1306WriteCmd(SSD1306_SETSTARTPAGE | ((m_row + m_pageOffset) & 7);

to: ssd1306WriteCmd(SSD1306_SETSTARTPAGE | ((m_row + m_pageOffset) & ((m_displayHeight/8)-1)) );

This seems to have solved the problem in my case, using a vertically orientated SH1107 oled with a resolution of 64x128. I hope this helps!

jonathanmlang avatar Mar 01 '23 18:03 jonathanmlang

I will Add this.

Also on horizontal bar graphs, you can use:

void ssd1306WriteRamBuf(uint8_t c);

greiman avatar Mar 01 '23 18:03 greiman

Thanks for that ill give it a try. This is by far my favourite display library so thanks for your work. Just trying to contribute a bit to show my appreciation.

jonathanmlang avatar Mar 01 '23 18:03 jonathanmlang

Your SH1107 mod may not work. The reason for the mask of 7 was not the display height but the memory pages in the SSD1306.

The SSD1306 has a 128x64 memory layout.

The SH1107 supports 128x128 so must have a different memory page layout.

greiman avatar Mar 01 '23 19:03 greiman

Indeed, could be all sorts ive missed. Its working fine with my display however.

jonathanmlang avatar Mar 01 '23 19:03 jonathanmlang

I tried the horizontal bar graph like this for 50 pixels long. I added this loop the Hello World:

  oled.print("Hello world!");
  // Test bar graph
  oled.println();
  for (uint8_t i = 0; i < 50; i++) {
    oled.ssd1306WriteRamBuf(0b00111100);
  }

greiman avatar Mar 01 '23 19:03 greiman

Yes I like that, using that function I have achieved a vertical bargraph too.

jonathanmlang avatar Mar 02 '23 22:03 jonathanmlang