Skip to content

Commit 76dd808

Browse files
authored
Merge pull request #38 from asmagill/main
Add support for small 0.66" 64x48 OLED
2 parents 267219f + 03b0300 commit 76dd808

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

adafruit_displayio_ssd1306.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
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>`_
2424
* Monochrome 0.49" 64x32 I2C OLED graphic display
25+
* Monochrome 0.66" 64x48 I2C OLED graphic display (eg https://www.amazon.com/gp/product/B07QF7QK6P)
2526
* Might work on other sub-128 width display: Dots 72x40, 64x48, 96x16
2627
2728
**Software and Dependencies:**
@@ -87,12 +88,15 @@ def __init__(
8788
col_offset = (
8889
0 if width == 128 else (128 - width) // 2
8990
) # https://github.com/micropython/micropython/pull/7411
91+
row_offset = (
92+
col_offset if (kwargs["height"] != 48 or kwargs["width"] != 64) else 0
93+
) # fix for 0.66" 64x48 OLED
9094
super().__init__(
9195
bus,
9296
init_sequence,
9397
**kwargs,
9498
colstart=col_offset,
95-
rowstart=col_offset,
99+
rowstart=row_offset,
96100
color_depth=1,
97101
grayscale=True,
98102
pixels_in_byte_share_row=False,

0 commit comments

Comments
 (0)