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

SSD1306 OLED display coordinates are offset #634

Open
Len42 opened this issue Sep 2, 2024 · 1 comment
Open

SSD1306 OLED display coordinates are offset #634

Len42 opened this issue Sep 2, 2024 · 1 comment

Comments

@Len42
Copy link

Len42 commented Sep 2, 2024

I'm using a 128x32 pixel SSD1306 SPI OLED display connected to a Daisy Seed, using daisy::OledDisplay<daisy::SSD130x4WireSpi128x32Driver>. Whenever I display anything, it is offset 32 pixels in the X direction. For example, this code:

display.Fill(false);
display.SetCursor(0,0);
display.WriteString("abcdefghijklmnop", true);
display.Update();

displays this:
OLED-bug

The letter "a" should appear at (0,0) but it shows up near the middle of the alphabet.

I tracked the problem to this line of code in libDaisy:

case 32: high_column_addr = 0x12; break;

If I delete that line, the display works fine:
OLED-ok

But it looks like that line of code was specifically added for 32-pixel-high displays, so I suspect that simply deleting it isn't the correct solution. Maybe different SSD1306 modules aren't perfectly compatible?

@stephenhensley
Copy link
Collaborator

I was working with a similar display, and had this same issue, and was also able to resolve it by commenting out that line..
At the time, I thought I was the unique one. Might just be the original author for 32-pixel-height had a display that was slightly different.

Might be worth seeing if/which displays require that extra high-column-addr offset, and making a separate driver for it, with most/everything else shared with the exitsting 130x driver.

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