File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 2121* `Monochrome 0.96" 128x64 OLED graphic display <https://www.adafruit.com/product/326>`_
2222* `Monochrome 128x32 SPI OLED graphic display <https://www.adafruit.com/product/661>`_
2323* `Adafruit FeatherWing OLED - 128x32 OLED <https://www.adafruit.com/product/2900>`_
24+ * Monochrome 0.49" 64x32 I2C OLED graphic display
25+ * Might work on other sub-128 width display: Dots 72x40, 64x48, 96x16
2426
2527**Software and Dependencies:**
2628
@@ -73,15 +75,22 @@ def __init__(
7375 # Patch the init sequence for 32 pixel high displays.
7476 init_sequence = bytearray (_INIT_SEQUENCE )
7577 height = kwargs ["height" ]
78+ width = kwargs ["width" ]
7679 if "rotation" in kwargs and kwargs ["rotation" ] % 180 != 0 :
7780 height = kwargs ["width" ]
81+ width = kwargs ["height" ]
7882 init_sequence [16 ] = height - 1 # patch mux ratio
79- if kwargs ["height" ] == 32 :
83+ if height == 32 and width == 64 : # FIX ME
84+ init_sequence [16 ] = 64 - 1 # FORCED for 64x32 because it fail with formula
85+ if (height == 32 or height == 16 ) and (width != 64 ):
8086 init_sequence [25 ] = 0x02 # patch com configuration
87+ col_offset = 0 if width == 128 else (128 - width ) // 2 # https://github.com/micropython/micropython/pull/7411
8188 super ().__init__ (
8289 bus ,
8390 init_sequence ,
8491 ** kwargs ,
92+ colstart = col_offset ,
93+ rowstart = col_offset ,
8594 color_depth = 1 ,
8695 grayscale = True ,
8796 pixels_in_byte_share_row = False ,
You can’t perform that action at this time.
0 commit comments