Skip to content

Commit 19ece18

Browse files
add setTextAlignment
1 parent 16768a4 commit 19ece18

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

SSD1306_OLEDDisplay_Mux/SSD1306_OLEDDisplay_Mux.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void SSD1306_OLEDDisplay_Mux::begin() {
3131
if (_flipVertical == true) {
3232
_display->flipScreenVertically();
3333
}
34-
_display->setTextAlignment(TEXT_ALIGN_CENTER);
34+
setTextAlignment(TEXT_ALIGN_CENTER);
3535
_display->setFont(Arimo_Regular_30);
3636

3737
_expander->closeChannel(_expanderChannel);
@@ -80,6 +80,10 @@ void SSD1306_OLEDDisplay_Mux::writeSmall(String msg, int16_t x, int16_t y, bool
8080
_expander->closeChannel(_expanderChannel);
8181
}
8282

83+
void SSD1306_OLEDDisplay_Mux::setTextAlignment(OLEDDISPLAY_TEXT_ALIGNMENT textAlignment) {
84+
_display->setTextAlignment(textAlignment);
85+
}
86+
8387
void SSD1306_OLEDDisplay_Mux::disable() {
8488
_expander->openChannel(_expanderChannel);
8589

SSD1306_OLEDDisplay_Mux/SSD1306_OLEDDisplay_Mux.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class SSD1306_OLEDDisplay_Mux {
2727
void loop();
2828
void disable();
2929
void enable();
30+
void setTextAlignment(OLEDDISPLAY_TEXT_ALIGNMENT textAlignment);
3031
void writeBig(String msg, int16_t x = 64, int16_t y = 0, bool clear_display = true);
3132
void writeSmall(String msg, int16_t x = 64, int16_t y = 4, bool clear_display = true);
3233
void drawImage(

0 commit comments

Comments
 (0)