mattjlewis / diozero

Java Device I/O library that is portable across Single Board Computers and microcontrollers. Tested with Raspberry Pi, Odroid C2, BeagleBone Black, Next Thing CHIP, Asus Tinker Board and Arduinos / Pico. Supports GPIO, I2C, SPI as well as Serial communication. Also known to work with Udoo Quad.
https://www.diozero.com
MIT License
261 stars 59 forks source link

SSDOled won't work for I2C channel #167

Closed EAGrahamJr closed 1 year ago

EAGrahamJr commented 1 year ago

I had a completely different display than those listed in core so I'd not paid much attention to the existing classes, but have recently received an OLED that says it's an SSD1306, but only 128 by 32, not 64. It's also I2C, thus

EAGrahamJr commented 1 year ago

I was attempting to tackle this and it got ugly really fast.

These are my thoughts, but since it's not my project and not my API, I will leave it to your discretion:

Recommendations:

EAGrahamJr commented 1 year ago

Additional note: since I don't have any of the Colour :grinning: OLED, I won't be able to test any changes against what's already there.

mattjlewis commented 1 year ago

Yes, a tricky one. I recall someone contributed the barebones of the I2C code. I typically use SPI for OLED coms hence cannot personally confirm whether it works or not via I2C. The ones I have could be both SPI and I2C, let me check. Also, it could be related to the fact that it is 128x32 rather than the 128x64 one that I test with.

EAGrahamJr commented 1 year ago

Oh, it definitely is - I'm referring to the CircuitPython drivers and some of the init/offsets are just slightly different.

If you can at least check that I didn't break anything, I think what I'm doing will work.

EAGrahamJr commented 1 year ago

BTW, I was the one that had started the I2C channel.

small-oled