Skip to Content
Circuitera

Budget SRAM for an Arduino monochrome OLED buffer

A packed monochrome buffer uses one bit per pixel.

0 of 3 complete · Progress saved on this device

Work out the example

A packed monochrome buffer uses one bit per pixel. For a width of 128 and height of 64, the buffer occupies 1,024 bytes. With the same width and half the height, it occupies half the memory.

How many bytes does a 128 × 32 one-bit framebuffer occupy?

Decide what to check next

The Uno’s 2,048 bytes of SRAM also hold globals, stack and other allocations. A successful link can coexist with failure in begin() when the display allocates its buffer at runtime.

Compare with the serial result

The sketch prints 512 and 1024 without allocating either framebuffer.

Open the exact Uno example

The sketch prints 512 and 1024 without allocating either framebuffer.

void setup() {
  Serial.begin(9600);
  Serial.println(128UL * 32 / 8);
  Serial.println(128UL * 64 / 8);
}
void loop() {}

Verified with [email protected] on Uno R3 (2026-12-05 UTC). This check did not use physical hardware.

Continue learning

Sources