adafruit / Adafruit_CircuitPython_DisplayIO_SSD1306

DisplayIO driver for SSD1306 monochrome OLED displays
MIT License
57 stars 24 forks source link

Adafruit 0.96 128x64 missing every 2nd scanline #32

Closed schwa closed 1 year ago

schwa commented 1 year ago

I have an Adafruit 0.96 128x64 OLED (https://www.adafruit.com/product/326) hooked up via I2C to a Adafruit RP2040 QT. I followed the instructions in the tutorial to get it working in CircuitPython (note - the code in tutorial would fail with "too many display buses" until I remembered I needed to do a displayio.release_displays() first).

While the tutorial does work - kind of - I am missing every 2nd horizontal line. See: IMG_4642

My setup code is:

displayio.release_displays()
i2c = board.STEMMA_I2C()
display_bus = displayio.I2CDisplay(i2c, device_address=0x3D)

WIDTH = 128
HEIGHT = 64  # Change to 64 if needed

display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=WIDTH, height=HEIGHT)

I initially thought perhaps a bad board? But after a quick web search it seems missing 2nd scan line is kinda common with these 1306 boards? (saw posts on Arduino forums). so I'm wondering if this is some kind of configuration bug?

Running: Adafruit CircuitPython 8.0.0-beta.5 on 2022-12-08; Adafruit QT Py RP2040 with rp2040

schwa commented 1 year ago

Playing with the HEIGHT parameter gets me some change in output but nothing at all that matches the quality of the product photos on the adafruit product page. Another screenshot:

IMG_4643 Large

ladyada commented 1 year ago

it looks you are initing it as a 128x32 not x64, maybe you are not saving files. or the display is cracked/damaged and affected. for more support post to the forums please.

dglaude commented 1 year ago

I am no expert, do not work for Adafruit and I don't have that screen, ... But you could try your screen with CircuitPython but not using DisplayIO using this library: https://github.com/adafruit/Adafruit_CircuitPython_SSD1306

If that works, then you would need to compare how the various register of the SSD1306 are initialized in both library.

There is micropython code too that can drive your screen.

Your last chance is to check if you get it working with Arduino.

It is possible that this library was working with your screen resolution, and the support was broken while trying to support various more resolution variations. So maybe a previous version was working.

Another trick that worked for me was to cheat on the resolution and pretend it was bigger and manually applying an offset. That was until I decided to work on a fix.

I massaged this library to support 64x32 screen in #31 hoping to not have break it for other resolution, but that PR is not accepted yet, so I am sure I did not break it for you. Maybe by chance (unlikely), my changes fix it for you, so you may want to try it.

Good luck, and keep us updated.