Skip to main content

Introduction

Documentation Status Discord Build Status Code Style: Ruff

Adafruit CircuitPython driver for SSD1306 or SSD1305 OLED displays. Note that SSD1305 displays are back compatible so they can be used in-place of SSD1306 with the same code and commands.

This driver implements the adafruit_framebuf interface. It is not the displayio driver for the SSD1306. See the Adafruit CircuitPython DisplayIO SSD1306 driver for displayio support.

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install adafruit-circuitpython-ssd1306

To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-ssd1306

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-ssd1306

Usage Example

# Basic example of clearing and drawing pixels on a SSD1306 OLED display.
# This example and library is meant to work with Adafruit CircuitPython API.
# Author: Tony DiCola
# License: Public Domain

# Import all board pins.
from board import SCL, SDA
import busio

# Import the SSD1306 module.
import adafruit_ssd1306


# Create the I2C interface.
i2c = busio.I2C(SCL, SDA)

# Create the SSD1306 OLED class.
# The first two parameters are the pixel width and pixel height.  Change these
# to the right size for your display!
display = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c)
# Alternatively you can change the I2C address of the device with an addr parameter:
#display = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c, addr=0x31)

# Clear the display.  Always call show after changing pixels to make the display
# update visible!
display.fill(0)

display.show()

# Set a pixel in the origin 0,0 position.
display.pixel(0, 0, 1)
# Set a pixel in the middle 64, 16 position.
display.pixel(64, 16, 1)
# Set a pixel in the opposite 127, 31 position.
display.pixel(127, 31, 1)
display.show()

More examples and details can be found in the adafruit_framebuf docs.

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Release files for adafruit-circuitpython-ssd1306 2.12.24

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adafruit-circuitpython-ssd1306 2.12.24
File Size Uploaded
adafruit_circuitpython_ssd1306-2.12.24.tar.gz 37.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adafruit-circuitpython-ssd1306 2.12.24
File Interpreter ABI Platform
adafruit_circuitpython_ssd1306-2.12.24-py3-none-any.whl Python 3 none any Details

Total release size: 45.3 kB

Release files / adafruit_circuitpython_ssd1306-2.12.24.tar.gz

Download URL adafruit_circuitpython_ssd1306-2.12.24.tar.gz
Size 37.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2728e88008b27787565eac1a99f063ecb94538d380855a8875db3bdd87ea5626
BLAKE2b-256 checksum
How to use checksums
7825f7dc77aa59354f477c1cbe143c07b40eed6414eb822d6bf98dd2e06cfba5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / adafruit_circuitpython_ssd1306-2.12.24-py3-none-any.whl

Download URL adafruit_circuitpython_ssd1306-2.12.24-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6bc9bf726cc7f8f8c79e1156d785a73dbf8770d64c2b78ec58396d4bfca4e1a
BLAKE2b-256 checksum
How to use checksums
5d846e6525dc9a974174ef002441f8959a667e6d9a37dfdb483974aaeb7221a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

2.12.24 This release

2 release files

2.12.9

2 release files

2.12.7

1 release file

2.12.6

1 release file

2.12.5

1 release file

2.12.4

1 release file

2.12.3

1 release file

2.12.2

1 release file

2.12.1

1 release file

2.12.0

1 release file

2.11.6

1 release file

2.11.5

1 release file

2.11.4

1 release file

2.11.3

1 release file

2.11.2

1 release file

2.11.1

1 release file

2.11.0

1 release file

2.10.2

1 release file

2.10.1

1 release file

2.10.0

1 release file

2.9.2

1 release file

2.9.1

1 release file

2.8.2

1 release file

2.8.1

1 release file

2.7.3

1 release file

2.7.2

1 release file

2.7.1

1 release file

2.7.0

1 release file

2.6.7

1 release file

2.6.6

1 release file

2.6.5

1 release file

2.6.4

1 release file

2.6.3

1 release file

2.6.2

1 release file

2.6.1

1 release file

2.5.0

1 release file

2.4.1

1 release file

2.4.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page