16 #ifndef WIPPERSNAPPER_I2C_DRIVER_OUT_SH1107_H 17 #define WIPPERSNAPPER_I2C_DRIVER_OUT_SH1107_H 20 #include <Adafruit_GFX.h> 21 #include <Adafruit_SH110X.h> 24 #define WS_SH1107_DEFAULT_WIDTH \ 26 #define WS_SH1107_DEFAULT_HEIGHT \ 29 #define OLED_128X64_WING_WIDTH 128 30 #define OLED_128X64_WING_HEIGHT 64 31 #define OLED_128X64_WING_ROTATION_90 1 65 _display->oled_command(SH110X_DISPLAYOFF);
94 _display->setTextColor(SH110X_WHITE);
153 _display->setTextColor(SH110X_WHITE);
161 size_t msg_size = strlen(message);
162 for (
size_t i = 0; i < msg_size && c_idx < msg_size; i++) {
163 if (message[i] ==
'\\' && i + 1 < msg_size &&
164 (message[i + 1] ==
'n' || message[i + 1] ==
'r')) {
166 if (message[i + 1] ==
'r' && i + 3 < msg_size &&
167 message[i + 2] ==
'\\' && message[i + 3] ==
'n') {
169 y_idx += line_height;
172 }
else if (message[i + 1] ==
'n') {
174 y_idx += line_height;
178 }
else if (message[i] == 0xC2 && message[i + 1] == 0xB0) {
208 #endif // WIPPERSNAPPER_I2C_DRIVER_OUT_SH1107_H void ConfigureSSD1306(uint8_t width, uint8_t height, uint8_t text_size, uint8_t rotation)
Configures a SSD1306 OLED display. Must be called before driver begin() - This is a fake function to ...
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:134
WipperSnapper_I2C_Driver_Out_SH1107(TwoWire *i2c, uint16_t sensorAddress)
Constructor for an SH1107 OLED display.
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:50
uint8_t _text_sz
Text size of the display.
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:205
uint8_t _width
Width of the display in pixels.
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:202
uint8_t _rotation
Rotation of the display (0-3)
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:204
uint8_t _height
Height of the display in pixels.
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:203
Derived class for I2C output component drivers.
Definition: WipperSnapper_I2C_Driver_Out.h:25
Adafruit_SH1107 * _display
Pointer to the Adafruit_SH1107 object.
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:200
~WipperSnapper_I2C_Driver_Out_SH1107()
Destructor for a SH1107 OLED display.
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:61
uint16_t _sensorAddress
The I2C driver's unique I2C address.
Definition: WipperSnapper_I2C_Driver.h:1322
#define OLED_128X64_WING_HEIGHT
Height of the 128x64 OLED FeatherWing.
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:30
bool begin()
Initializes the SH1107 display and begins I2C.
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:75
#define OLED_128X64_WING_ROTATION_90
Rotation of OLED FeatherWing 0-3.
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:31
#define WS_SH1107_DEFAULT_WIDTH
Default width for a sh1107 128x64 display.
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:24
Class that provides a driver interface for a SH1107 OLED Display.
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:37
#define WS_SH1107_DEFAULT_HEIGHT
Default height for a sh1107 128x64 display.
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:26
#define OLED_128X64_WING_WIDTH
Width of the 128x64 OLED FeatherWing.
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:29
void WriteMessageSSD1306(const char *message)
Writes a message to the fake "SSD1306" SH1107 display.
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:194
void WriteMessageSH1107(const char *message)
Writes a message to the SH1107 display.
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:145
TwoWire * _i2c
Pointer to the I2C driver's Wire object.
Definition: WipperSnapper_I2C_Driver.h:1321
void ConfigureSH1107(uint8_t width, uint8_t height, uint8_t text_size, uint8_t rotation)
Configures a SH1107 OLED display. Must be called before driver begin()
Definition: WipperSnapper_I2C_Driver_Out_Sh1107.h:114