File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,16 @@ def power(self):
8989
9090 def init_display (self ):
9191 """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
92102 for cmd in (
93103 SET_DISP | 0x00 , # off
94104 # address setting
@@ -103,7 +113,9 @@ def init_display(self):
103113 SET_DISP_OFFSET ,
104114 0x00 ,
105115 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 ,
107119 # timing and driving scheme
108120 SET_DISP_CLK_DIV ,
109121 0x80 ,
You can’t perform that action at this time.
0 commit comments