Adafruit 128x64 OLED Bonnet for Raspberry Pi
Created by lady ada
Last updated on 2018-08-22 04:00:56 PM UTC
Guide Contents
Guide Contents
Overview
Usage
Step 1. Dependencies
Step 2. Enable i2c
Step 3. Verify I2C Device
Running Scripts on Boot
Library Usage
Python library setup
Pin Setup
Display Setup
Display Initialization
Button Input & Drawing
2
3
6
6
7
7
8
8
8
9
9
10
10
More Demos & Examples
Speeding Up the Display
Downloads
Files
Schematic & Fabrication Print
11
12
14
14
14
© Adafruit Industries
https://learn.adafruit.com/adafruit-128x64-oled-bonnet-for-raspberry-pi
Page 2 of 15
Overview
If you'd like a compact display, with buttons and a joystick - we've got what you're looking for. The Adafruit 128x64
OLED Bonnet for Raspberry Pi is
the big sister to our mini PiOLED add-on
(https://adafru.it/wVd).
This version has
128x64 pixels (instead of 128x32) and a much larger screen besides. With the OLED display in the center, we had
some space on either side so we added a 5-way joystick and two pushbuttons. Great for when you want to have a
control interface for your project.
© Adafruit Industries
https://learn.adafruit.com/adafruit-128x64-oled-bonnet-for-raspberry-pi
Page 3 of 15
These displays are small, only about 1.3" diagonal, but very readable due to the high contrast of an OLED display. This
screen is made of 128x64 individual white OLED pixels and because the display makes its own light, no backlight is
required. This reduces the power required to run the OLED and is why the display has such high contrast; we really
like this miniature display for its crispness!
© Adafruit Industries
https://learn.adafruit.com/adafruit-128x64-oled-bonnet-for-raspberry-pi
Page 4 of 15
Please note that this display is too small to act as a primary display for the Pi (e.g. it can't act like or display what
would normally be on the HDMI screen). Instead, we recommend using pygame for drawing or writing text.
Using the display and controls in python is very easy, we have a library ready-to-go for the SSD1306 OLED chipset and
the joystick/buttons are connected to GPIO pins on the Pi. Our example code allows you to draw images, text,
whatever you like, using the Python imaging library. We also have example code for using the joystick/buttons/OLED
together. Our tests showed 15 FPS update rates once you bump the I2C speed to 1MHz, so you can do animations or
simple video.
Comes completely pre-assembled and tested so you don't need to do anything but plug it in and install our Python
code! Works with any Raspberry Pi computer, including the original Pi 1, B+, Pi 2, Pi 3 and Pi Zero.
© Adafruit Industries
https://learn.adafruit.com/adafruit-128x64-oled-bonnet-for-raspberry-pi
Page 5 of 15