Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
EAGrahamJr opened this issue Jul 12, 2024 · 4 comments
Closed

Comments

@EAGrahamJr
Copy link
Contributor

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()
@EAGrahamJr
Copy link
Contributor Author

20240712_102220

@EAGrahamJr
Copy link
Contributor Author

Note the same issue occurs on Raspberry Pi using Blinka (the red frame in the picture does not obscure any part of the OLED screen).

image

@EAGrahamJr
Copy link
Contributor Author

Might be related to adafruit/Adafruit_Blinka_Displayio#135

@EAGrahamJr
Copy link
Contributor Author

User error using labels and a knock-off display

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant