I am trying to use this library to drive the Adafruit MacroPad's SH1106 display without using the MacroPad library and it appears that whatever is drawn on the screen gets shifted slightly to the left. This problem does not occur on the CircuitPython boot screen or on code that does not rely on this library, such as the arduino-based demo code it came with or the code from this guide.
The below image shows what happens when I try to write "Hello World" at (0,0) (code at bottom). Note the extra pixels on the right edge, which I believe is part of the CircuitPython boot screen that did not get erased when the display was initialized.
Here is a picture of the CircuitPython boot screen. The rightmost part of the "n" at the end of the second line appears to line up with the extra pixels in the above picture.
The code that I used:
import busio
import board
import displayio
import terminalio
from adafruit_display_text import label
import adafruit_displayio_sh1106
displayio.release_displays()
# Use for SPI
spi = busio.SPI(board.SCK, board.MOSI)
display_bus = displayio.FourWire(
spi,
command=board.OLED_DC,
chip_select=board.OLED_CS,
reset=board.OLED_RESET,
baudrate=1000000,
)
display = adafruit_displayio_sh1106.SH1106(display_bus, width=128, height=64)
# Make the display context
splash = displayio.Group()
display.show(splash)
# Draw a label
text = "Hello, World!"
text_area = label.Label(
terminalio.FONT,
text=text,
color=0xFFFFFF,
anchor_point=(0.0, 0.0),
anchored_position=(0, 0),
)
splash.append(text_area)
while True:
pass
I am trying to use this library to drive the Adafruit MacroPad's SH1106 display without using the MacroPad library and it appears that whatever is drawn on the screen gets shifted slightly to the left. This problem does not occur on the CircuitPython boot screen or on code that does not rely on this library, such as the arduino-based demo code it came with or the code from this guide.
The below image shows what happens when I try to write "Hello World" at (0,0) (code at bottom). Note the extra pixels on the right edge, which I believe is part of the CircuitPython boot screen that did not get erased when the display was initialized.
Here is a picture of the CircuitPython boot screen. The rightmost part of the "n" at the end of the second line appears to line up with the extra pixels in the above picture.
The code that I used: