Skip to content

Commit 1f8c689

Browse files
committed
Add logging around OLEDs
1 parent 5cd7b1c commit 1f8c689

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_Sh1107.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ class WipperSnapper_I2C_Driver_Out_SH1107
9494
_display->clearDisplay();
9595
_display->display();
9696
_display->print(char('a'));
97+
delay(500);
98+
_display->write(char('b'));
9799
_display->display();
98100
return true;
99101
}
@@ -112,7 +114,7 @@ class WipperSnapper_I2C_Driver_Out_SH1107
112114
_width = width;
113115
_height = height;
114116
_text_sz = text_size;
115-
WS_DEBUG_PRINT("text size: ");
117+
WS_DEBUG_PRINT("SH1107 text size: ");
116118
WS_DEBUG_PRINTLN(text_size);
117119
}
118120

@@ -124,7 +126,7 @@ class WipperSnapper_I2C_Driver_Out_SH1107
124126
void WriteMessageSH1107(const char *message) {
125127
if (_display == nullptr)
126128
return;
127-
WS_DEBUG_PRINT("Message:");
129+
WS_DEBUG_PRINT("SH1107 Message:");
128130
WS_DEBUG_PRINTLN(message);
129131
// Start with a fresh display buffer
130132
// and settings
@@ -148,11 +150,15 @@ class WipperSnapper_I2C_Driver_Out_SH1107
148150
message[i + 2] == '\\' && message[i + 3] == 'n') {
149151
// Skip to the next line
150152
y_idx += line_height;
153+
WS_DEBUG_PRINT("SH1107 Newline at: ");
154+
WS_DEBUG_PRINTLN(y_idx);
151155
_display->setCursor(0, y_idx);
152156
i += 3;
153157
} else if (message[i + 1] == 'n') {
154158
// Skip to the next line
155159
y_idx += line_height;
160+
WS_DEBUG_PRINT("SH1107 Newline at: ");
161+
WS_DEBUG_PRINTLN(y_idx);
156162
_display->setCursor(0, y_idx);
157163
i++;
158164
}

src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_Ssd1306.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ class WipperSnapper_I2C_Driver_Out_Ssd1306
9595
_width = width;
9696
_height = height;
9797
_text_sz = text_size;
98+
WS_DEBUG_PRINT("SSD1306 text size: ");
99+
WS_DEBUG_PRINTLN(text_size);
98100
}
99101

100102
/*!
@@ -106,6 +108,9 @@ class WipperSnapper_I2C_Driver_Out_Ssd1306
106108
if (_display == nullptr)
107109
return;
108110

111+
WS_DEBUG_PRINT("SSD1306 Message:");
112+
WS_DEBUG_PRINTLN(message);
113+
109114
// Start with a fresh display buffer
110115
// and settings
111116
int16_t y_idx = 0;

0 commit comments

Comments
 (0)