SSD1306 128x32 OLED

The 0.91 inch OLED strip: 128 by 32 pixels on the same SSD1306 as the 128x64 module, on the same two wires at the same address, 0x3C.

Aliases: 0.91 inch OLED, 128x32 OLED.

The controller still has eight pages of RAM. The glass is wired to the first 32 rows, so pages 0 to 3 are what shows and pages 4 to 7 are memory nobody can see.

Pins

Pin What it does
GND Ground.
VCC Supply, 3.3 V or 5 V.
SCL Open-drain clock; the module has its own pull-up.
SDA Open-drain data; the module has its own pull-up.

Properties

address: the I2C address, 0x3C by default.

What the model gets right

Everything the 128x64 part does: the command set in all three addressing modes, the charge pump that has to be switched on with 0x8D 0x14, the remaps that turn the picture upright, contrast, inverse. A sketch told it is driving a 128x32 draws in pages 0 to 3 and fills the strip.

What it does not model

The multiplex ratio (0xA8) and the COM pin setting (0xDA) are kept and not acted on. On the bench, a 128x64 set-up sent to this strip squashes the whole 64-row picture onto it, every other row. Here it shows the top half of the picture instead. A sketch that says 128, 32 sends the right set-up and looks the same either way. The rest of the list on the 128x64 page applies here too.

Code

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

Adafruit_SSD1306 display(128, 32, &Wire, -1);

void setup() {
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 8);
  display.print("128x32");
  display.display();
}

void loop() {}

Common mistakes

Telling the library 128, 64: the picture is twice as tall as the glass and the bottom half is drawn where nobody can see it. Forgetting the charge pump in a hand-written driver, exactly as on the bigger module.

See it in action

Three small screens at /templates starts this strip by hand, charge pump, multiplex and all, beside an SH1106 and a Nokia 5110.