Working with OLED Displays

OLED (Organic Light-Emitting Diode) displays are one of the most fun components to work with because they open up many creative possibilities. You can build games, create dashboards, or display sensor readings visually.

The SSD1306 Controller

The SSD1306 is the integrated controller chip that powers many small OLED displays, including the 0.96-inch 128x64 module we'll use. This controller handles communication between the Pico and the OLED panel using I2C protocol.

Display Specifications

  • Resolution: 128 x 64 pixels (8,192 total pixels)
  • Size: 0.96 inches diagonal
  • Color: Monochrome (white pixels on black background)
  • Operating Voltage: 3.3V
  • Communication: I2C (address typically 0x3C)

Wiring the OLED Display

Pico PinOLED Pin
GPIO 16SDA
GPIO 17SCL
3.3VVCC
GNDGND

Using embedded-graphics

We'll use two main crates: embedded-graphics for drawing and ssd1306 for hardware control. The embedded-graphics crate provides high-level drawing commands for shapes, text, and images, while the ssd1306 driver handles the low-level hardware communication.

Projects Covered

Drawing Workflow

  1. Create shapes, text, or images using embedded-graphics primitives
  2. Call .draw(&mut display) to render to the internal buffer
  3. Call display.flush() to send the buffer to the physical screen

Complete examples for displaying text, raw images, and BMP files are available in the project repositories for both Embassy (async) and rp-hal (blocking) implementations.