File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,13 @@ def __init__(
131
131
rotation = 0 ,
132
132
** kwargs
133
133
):
134
+ rotation = (rotation + _ROTATION_OFFSET ) % 360
135
+ if rotation in (0 , 180 ):
136
+ multiplex = kwargs ["width" ] - 1
137
+ else :
138
+ multiplex = kwargs ["height" ] - 1
134
139
init_sequence = bytearray (_INIT_SEQUENCE )
140
+ init_sequence [16 ] = multiplex
135
141
init_sequence [19 ] = display_offset
136
142
super ().__init__ (
137
143
bus ,
@@ -143,7 +149,7 @@ def __init__(
143
149
data_as_commands = True , # every byte will have a command byte preceding
144
150
brightness_command = 0x81 ,
145
151
single_byte_bounds = True ,
146
- rotation = ( rotation + _ROTATION_OFFSET ) % 360 ,
152
+ rotation = rotation ,
147
153
# for sh1107 use column and page addressing.
148
154
# lower column command = 0x00 - 0x0F
149
155
# upper column command = 0x10 - 0x17
You can’t perform that action at this time.
0 commit comments