bitbank2 / ss_oled

Simple and small library to control 1-bpp OLED displays (Linux + Arduino)
GNU General Public License v3.0
186 stars 34 forks source link

Support for display SH1107 #52

Closed guhland closed 2 years ago

guhland commented 2 years ago

I have a display that is a SH1107 that is oriented 64x128 instead of 128x64. I am trying to use this library to change the orientation from portrait to landscape. Not having much luck. Right now I cannot even get it to display correctly using the 128x64 code...

bitbank2 commented 2 years ago

(sorry - this comment refers to my OneBitDisplay library. I don't currently support the SH1107 in this library)

I just added support for that display recently. Choose OLED_64x128 as the display type. Those displays don't support 90 degree rotation natively, but do support 180 (I called it flipped). The support in the library for 90/270 degree rotation is just in the obdScaledString() function for the FONT_6x8 and FONT_8x8. Any other drawing at 90/270 will need to be done by your own custom code. Another issue is that using the obdScaledString() function requires that you define a back buffer since the display memory is oriented differently. If you don't or can't allocate 1K for a backbuffer, then you'll need to use the display in portrait mode.