OLED display, 1.12 inch SH1107
A square 1.12 inch 128 by 128 monochrome OLED on the Sino Wealth SH1107, over I2C.
It matches the Grove OLED Display 1.12 and Adafruit's 128x128 OLED. Aliases: SH1107, Grove OLED, 128x128 OLED.
Pins
| Pin | What it does |
|---|---|
GND, VCC |
Supply, 3.3 or 5 V. |
SDA, SCL |
The I2C bus, address 0x3C. The board has the pull-ups. |
Reading it on an Arduino
With Adafruit's SH110X library, which Mokxi ships as Adafruit_SH110X.h:
#include <Adafruit_GFX.h>
#include <Adafruit_SH110X.h>
Adafruit_SH1107 display(128, 128, &Wire);
void setup() {
display.begin(0x3C, true);
display.clearDisplay();
display.setTextColor(SH110X_WHITE);
display.print("Hello");
display.display();
}
The library keeps the whole picture in RAM: 2048 bytes, all of an Uno's. Use a Mega, an ESP32 or a Pico.
What the model gets right
From the SH1107 datasheet: the 128 by 128 RAM in sixteen pages; page and vertical addressing; the column and page address commands; contrast, inversion and every pixel on; the multiplex ratio, display offset and start line; segment remap and COM scan direction; and the SSD1306 family's control bytes on the bus.
What it does not model
Whether the charge pump setting lights the glass (the modules supply the panel voltage themselves), reading the RAM back, the bare chip's SPI interface, and the burn-in and fading of a real OLED.
Common mistakes
Running Adafruit's library on an Uno: the 2 KB frame does not fit.
Using an SH1106 or SSD1306 driver: the SH1107 has sixteen pages, not eight, and its addressing mode commands take no parameter.
See it in action
Grove OLED bounces a ball on a Mega. Open it at /templates.