File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,16 @@ def power(self):
89
89
90
90
def init_display (self ):
91
91
"""Base class to initialize display"""
92
+ # The various screen sizes available with the ssd1306 OLED driver
93
+ # chip require differing configuration values for the display clock
94
+ # div and com pin, which are listed below for reference and future
95
+ # compatibility:
96
+ # w, h: DISP_CLK_DIV COM_PIN_CFG
97
+ # 128, 64: 0x80 0x12
98
+ # 128, 32: 0x80 0x02
99
+ # 96, 16: 0x60 0x02
100
+ # 64, 48: 0x80 0x12
101
+ # 64, 32: 0x80 0x12
92
102
for cmd in (
93
103
SET_DISP | 0x00 , # off
94
104
# address setting
@@ -103,7 +113,9 @@ def init_display(self):
103
113
SET_DISP_OFFSET ,
104
114
0x00 ,
105
115
SET_COM_PIN_CFG ,
106
- 0x02 if self .height == 32 or self .height == 16 else 0x12 ,
116
+ 0x02
117
+ if (self .height == 32 or self .height == 16 ) and (self .width != 64 )
118
+ else 0x12 ,
107
119
# timing and driving scheme
108
120
SET_DISP_CLK_DIV ,
109
121
0x80 ,
You can’t perform that action at this time.
0 commit comments