Skip to content

SH1106 requires a "row offset" due to RAM buffer size differences #20

Closed
@EAGrahamJr

Description

@EAGrahamJr

This chip has a slightly larger memory buffer per row than the SH1107 (132 vs 128), so currently the display is shifted and also draws a white line on the right-hand side.

NOTE This is running the modified driver from #19

20240712_101053

Code running in picture:

import time, board,  displayio, i2cdisplaybus, terminalio
import adafruit_displayio_sh1106

# Select one to run
from adafruit_display_text import bitmap_label as label
# from adafruit_display_text import label as label

displayio.release_displays()
dw,dh = 128, 64

i2c = board.STEMMA_I2C()
display_bus = i2cdisplaybus.I2CDisplayBus(i2c, device_address=0x3C)
display = adafruit_displayio_sh1106.SH1106(display_bus, width=dw, height=dh)
display.wake()

maingroup = displayio.Group()
display.root_group = maingroup
text1 = label.Label(terminalio.FONT, text="helloworld...")
text1.anchor_point = (0.0, 0.0)
text1.anchored_position = (0, 0)
text2 = label.Label(terminalio.FONT, text="@edgjr       ")
text2.anchor_point = (0.0, 0.0)
text2.anchored_position = (0, dh / 2)


for t in (text1, text2):
    maingroup.append(t)

while True:
    try:
        text2.text = "%.1f" % time.monotonic()
        time.sleep(0.1)
    except KeyboardInterrupt:
        break

display.sleep()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions