File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ def init_display(self):
99
99
SET_MUX_RATIO , self .height - 1 ,
100
100
SET_COM_OUT_DIR | 0x08 , # scan from COM[N] to COM0
101
101
SET_DISP_OFFSET , 0x00 ,
102
- SET_COM_PIN_CFG , 0x02 if self .height == 32 else 0x12 ,
102
+ SET_COM_PIN_CFG , 0x02 if self .height == 32 or self . height == 16 else 0x12 ,
103
103
# timing and driving scheme
104
104
SET_DISP_CLK_DIV , 0x80 ,
105
105
SET_PRECHARGE , 0x22 if self .external_vcc else 0xf1 ,
@@ -112,6 +112,9 @@ def init_display(self):
112
112
SET_CHARGE_PUMP , 0x10 if self .external_vcc else 0x14 ,
113
113
SET_DISP | 0x01 ): # on
114
114
self .write_cmd (cmd )
115
+ if self .width == 72 :
116
+ self .write_cmd (0xAD )
117
+ self .write_cmd (0x30 )
115
118
self .fill (0 )
116
119
self .show ()
117
120
@@ -157,6 +160,10 @@ def show(self):
157
160
# displays with width of 64 pixels are shifted by 32
158
161
xpos0 += 32
159
162
xpos1 += 32
163
+ if self .width == 72 :
164
+ # displays with width of 72 pixels are shifted by 28
165
+ xpos0 += 28
166
+ xpos1 += 28
160
167
self .write_cmd (SET_COL_ADDR )
161
168
self .write_cmd (xpos0 )
162
169
self .write_cmd (xpos1 )
You can’t perform that action at this time.
0 commit comments