Skip to content

Commit

Permalink
Merge pull request #24 from FoamyGuy/rotation_fix
Browse files Browse the repository at this point in the history
Rotation fix
  • Loading branch information
FoamyGuy authored Nov 20, 2024
2 parents 7036bb7 + 90a8fbe commit 4b82f58
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 1 addition & 4 deletions adafruit_displayio_sh1107.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
b"\xaf\x00" # DISPLAY_ON
)
_PIXELS_IN_ROW = True
_ROTATION_OFFSET = 0
else:
_INIT_SEQUENCE = (
b"\xae\x00" # display off, sleep mode
Expand All @@ -142,7 +141,6 @@
b"\xaf\x00" # DISPLAY_ON
)
_PIXELS_IN_ROW = False
_ROTATION_OFFSET = 90


class SH1107(Display):
Expand All @@ -163,10 +161,9 @@ def __init__(
self,
bus: Union[I2CDisplayBus, FourWire],
display_offset: int = DISPLAY_OFFSET_ADAFRUIT_FEATHERWING_OLED_4650,
rotation: int = 0,
rotation: int = 90,
**kwargs
) -> None:
rotation = (rotation + _ROTATION_OFFSET) % 360
if rotation in (0, 180):
multiplex = kwargs["width"] - 1
else:
Expand Down
4 changes: 1 addition & 3 deletions examples/displayio_sh1107_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
HEIGHT = 64
BORDER = 2

display = adafruit_displayio_sh1107.SH1107(
display_bus, width=WIDTH, height=HEIGHT, rotation=0
)
display = adafruit_displayio_sh1107.SH1107(display_bus, width=WIDTH, height=HEIGHT)

# Make the display context
splash = displayio.Group()
Expand Down

0 comments on commit 4b82f58

Please sign in to comment.