Skip to content

Commit 4b82f58

Browse files
authored
Merge pull request #24 from FoamyGuy/rotation_fix
Rotation fix
2 parents 7036bb7 + 90a8fbe commit 4b82f58

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

adafruit_displayio_sh1107.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@
122122
b"\xaf\x00" # DISPLAY_ON
123123
)
124124
_PIXELS_IN_ROW = True
125-
_ROTATION_OFFSET = 0
126125
else:
127126
_INIT_SEQUENCE = (
128127
b"\xae\x00" # display off, sleep mode
@@ -142,7 +141,6 @@
142141
b"\xaf\x00" # DISPLAY_ON
143142
)
144143
_PIXELS_IN_ROW = False
145-
_ROTATION_OFFSET = 90
146144

147145

148146
class SH1107(Display):
@@ -163,10 +161,9 @@ def __init__(
163161
self,
164162
bus: Union[I2CDisplayBus, FourWire],
165163
display_offset: int = DISPLAY_OFFSET_ADAFRUIT_FEATHERWING_OLED_4650,
166-
rotation: int = 0,
164+
rotation: int = 90,
167165
**kwargs
168166
) -> None:
169-
rotation = (rotation + _ROTATION_OFFSET) % 360
170167
if rotation in (0, 180):
171168
multiplex = kwargs["width"] - 1
172169
else:

examples/displayio_sh1107_simpletest.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@
3838
HEIGHT = 64
3939
BORDER = 2
4040

41-
display = adafruit_displayio_sh1107.SH1107(
42-
display_bus, width=WIDTH, height=HEIGHT, rotation=0
43-
)
41+
display = adafruit_displayio_sh1107.SH1107(display_bus, width=WIDTH, height=HEIGHT)
4442

4543
# Make the display context
4644
splash = displayio.Group()

0 commit comments

Comments
 (0)