File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 34
34
#include " OLEDDisplay.h"
35
35
#include < Wire.h>
36
36
37
+ #if defined(ARDUINO_ARCH_ESP32)
38
+ #define I2C_OLED_TRANSFER_BYTE 64 /* * ESP32 can Transfer Max 128 bytes */
39
+ #else
40
+ #define I2C_OLED_TRANSFER_BYTE 16
41
+ #endif
42
+
37
43
#define SH1106_SET_PUMP_VOLTAGE 0X30
38
44
#define SH1106_SET_PUMP_MODE 0XAD
39
45
#define SH1106_PUMP_ON 0X8B
@@ -142,7 +148,7 @@ class SH1106Wire : public OLEDDisplay {
142
148
}
143
149
_wire->write (buffer[x + y * displayWidth]);
144
150
k++;
145
- if (k == 16 ) {
151
+ if (k == I2C_OLED_TRANSFER_BYTE ) {
146
152
_wire->endTransmission ();
147
153
k = 0 ;
148
154
}
@@ -163,10 +169,10 @@ class SH1106Wire : public OLEDDisplay {
163
169
sendCommand (0xB0 +y);
164
170
sendCommand (0x02 );
165
171
sendCommand (0x10 );
166
- for ( uint8_t x=0 ; x<8 ; x++) {
172
+ for ( uint8_t x=0 ; x<( 128 /I2C_OLED_TRANSFER_BYTE) ; x++) {
167
173
_wire->beginTransmission (_address);
168
174
_wire->write (0x40 );
169
- for (uint8_t k = 0 ; k < 16 ; k++) {
175
+ for (uint8_t k = 0 ; k < I2C_OLED_TRANSFER_BYTE ; k++) {
170
176
_wire->write (*p++);
171
177
}
172
178
_wire->endTransmission ();
You can’t perform that action at this time.
0 commit comments