From bf61c2029d331d6dcab4bf8f0315fd6a0a89ae2c Mon Sep 17 00:00:00 2001 From: asmagill Date: Thu, 4 Jan 2024 10:12:22 -0600 Subject: [PATCH 1/3] fix for 0.66" 64x48 OLED --- adafruit_displayio_ssd1306.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/adafruit_displayio_ssd1306.py b/adafruit_displayio_ssd1306.py index 8aa98b4..2810d52 100644 --- a/adafruit_displayio_ssd1306.py +++ b/adafruit_displayio_ssd1306.py @@ -87,12 +87,15 @@ def __init__( col_offset = ( 0 if width == 128 else (128 - width) // 2 ) # https://github.com/micropython/micropython/pull/7411 + row_offset = ( + col_offset if (kwargs["height"] != 48 or kwargs["width"] != 64) else 0 + ) # fix for 0.66" 64x48 OLED super().__init__( bus, init_sequence, **kwargs, colstart=col_offset, - rowstart=col_offset, + rowstart=row_offset, color_depth=1, grayscale=True, pixels_in_byte_share_row=False, From 0eebdffe47b6b8ff1e51df5bfb86f1382b2c576a Mon Sep 17 00:00:00 2001 From: asmagill Date: Fri, 5 Jan 2024 13:20:50 -0600 Subject: [PATCH 2/3] add note to Hardware section doc string --- adafruit_displayio_ssd1306.py | 1 + 1 file changed, 1 insertion(+) diff --git a/adafruit_displayio_ssd1306.py b/adafruit_displayio_ssd1306.py index 2810d52..6cf2a21 100644 --- a/adafruit_displayio_ssd1306.py +++ b/adafruit_displayio_ssd1306.py @@ -22,6 +22,7 @@ * `Monochrome 128x32 SPI OLED graphic display `_ * `Adafruit FeatherWing OLED - 128x32 OLED `_ * Monochrome 0.49" 64x32 I2C OLED graphic display +* Monochrome 0.66" 64x48 I2C OLED graphic display (like https://www.amazon.com/gp/product/B07QF7QK6P) * Might work on other sub-128 width display: Dots 72x40, 64x48, 96x16 **Software and Dependencies:** From 03b0300b8b567ee9438606da231775ca6b849f01 Mon Sep 17 00:00:00 2001 From: asmagill Date: Fri, 19 Jan 2024 12:16:23 -0600 Subject: [PATCH 3/3] ran pre-commit --- adafruit_displayio_ssd1306.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_displayio_ssd1306.py b/adafruit_displayio_ssd1306.py index 6cf2a21..13edd14 100644 --- a/adafruit_displayio_ssd1306.py +++ b/adafruit_displayio_ssd1306.py @@ -22,7 +22,7 @@ * `Monochrome 128x32 SPI OLED graphic display `_ * `Adafruit FeatherWing OLED - 128x32 OLED `_ * Monochrome 0.49" 64x32 I2C OLED graphic display -* Monochrome 0.66" 64x48 I2C OLED graphic display (like https://www.amazon.com/gp/product/B07QF7QK6P) +* Monochrome 0.66" 64x48 I2C OLED graphic display (eg https://www.amazon.com/gp/product/B07QF7QK6P) * Might work on other sub-128 width display: Dots 72x40, 64x48, 96x16 **Software and Dependencies:** @@ -90,7 +90,7 @@ def __init__( ) # https://github.com/micropython/micropython/pull/7411 row_offset = ( col_offset if (kwargs["height"] != 48 or kwargs["width"] != 64) else 0 - ) # fix for 0.66" 64x48 OLED + ) # fix for 0.66" 64x48 OLED super().__init__( bus, init_sequence,