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

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

Open
jonathanmlang opened this issue Mar 1, 2023 · 6 comments

Comments

@jonathanmlang
Copy link

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 added a commit to jonathanmlang/SSD1306Ascii that referenced this issue Mar 1, 2023
Requires the fix in issue greiman#104 to be applied.
@greiman
Copy link
Owner

greiman commented Mar 1, 2023

I will Add this.

Also on horizontal bar graphs, you can use:

void ssd1306WriteRamBuf(uint8_t c);

@jonathanmlang
Copy link
Author

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.

@greiman
Copy link
Owner

greiman commented Mar 1, 2023

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.

@jonathanmlang
Copy link
Author

jonathanmlang commented Mar 1, 2023

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

@greiman
Copy link
Owner

greiman commented Mar 1, 2023

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);
  }

@jonathanmlang
Copy link
Author

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

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

2 participants