Arduino Library & Examples | Monochrome OLED Breakouts

Skip to main content Monochrome OLED Breakouts Arduino Library & Examples
  • Overview
  • Power Requirements
  • Arduino Library & Examples
  • Wiring 128x64 OLEDs
  • Wiring 128x32 SPI OLED display
  • Wiring 128x32 I2C Display
  • Wiring OLD 0.96" 128x64 OLED
  • CircuitPython Wiring
  • CircuitPython Setup
  • CircuitPython Usage
  • Python Wiring
  • Python Setup
  • Python Usage
  • Troubleshooting
  • Downloads
  • Single page
  • Feedback? Corrections?
  • Text View
Featured Products view all
  • Your browser does not support the video tag. Monochrome 1.3" OLED module with Adafruit logos falling like snow Monochrome 1.3" 128x64 OLED graphic display - STEMMA QT / Qwiic $19.95 Add to Cart
  • Monochrome 0.96" OLED module with Adafruit logo Monochrome 0.96" 128x64 OLED Graphic Display - STEMMA QT Out of Stock
  • Angled Front Shot of the OLED Graphic Display. Monochrome 128x32 SPI OLED graphic display $17.50 Add to Cart
  • Monochrome 0.91" I2C OLED module with white text Monochrome 128x32 I2C OLED graphic display No Longer Stocked
  • Your browser does not support the video tag. Monochrome OLED module wired to Feather showing text and circles Monochrome 0.91" 128x32 I2C OLED Display - STEMMA QT / Qwiic $12.50 Add to Cart
161 Beginner Skill guide

Arduino Library & Examples

For all of the different kinds of small OLED monochrome displays, you'll need to install the Arduino libraries. The code we have is for any kind of Arduino, if you're using a different microcontroller, the code is pretty simple to adapt, the interface we use is basic bit-twiddling SPI or I2C

Install Arduino Libraries

Using these OLEDs with Arduino sketches requires that two libraries be installed: Adafruit_SSD1306, which handles the low-level communication with the hardware, and Adafruit_GFX, which builds atop this to add graphics functions like lines, circles and text.

In recent versions of the Arduino IDE software (1.6.2 and later), this is most easily done through the Arduino Library Manager.

Open up the Arduino library manager:

adafruit_products_library_manager_menu.png

Search for the Adafruit SSD1306 library and install it

adafruit_products_ssd1306.png

Search for the Adafruit GFX library and install it

adafruit_products_gfx.png

If using an earlier version of the Arduino IDE (prior to 1.8.10), also locate and install Adafruit_BusIO (newer versions will install this dependency automatically).

We also have a great tutorial on Arduino library installation here:http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use

Run Demo!

After installing the Adafruit_SSD1306 and Adafruit_GFX library, restart the Arduino IDE. You should now be able to access the sample code by navigating through menus in this order: File→Examples→Adafruit_SSD1306→SSD1306...

lcds___displays_Screenshot_1.png

After you've finished wiring the display as indicated on the following pages, load the example sketch to demonstrate the capabilities of the library and display.

The OLED SSD1306 driver is based on the Adafruit GFX library which provides all the underlying graphics functions such as drawing pixels, lines, circles, etc. For more details about what you can do with the OLED check out the GFX library tutorial

lcds___displays_oled12864logo_LRG.jpg lcds___displays_oled12864chars_LRG.jpg

Create Bitmaps with LCD Assistant

You can create bitmaps to display easily with the LCD assistant software. First make your image using any kind of graphics software such as photoshop or Paint and save as a Monochrome Bitmap (bmp)

lcds___displays_bitmapmono.gif Select the following options (You might also want to try Horizontal if Vertical is not coming out right) lcds___displays_bitmapconvert.gif and import your monochrome bitmap image. Save the output to a cpp file lcds___displays_bitmapsave.gif You can use the output directly with our example code lcds___displays_bitmapout.gif

Create Bitmaps with image2cpp

image2cpp was created by GitHub user javl and provides a handy way to create bitmaps without installing any additional software. Just visit https://javl.github.io/image2cpp/, upload an image, put in any settings that you would like to use, select a format and generate the code. You can copy the code right into your sketch. If you're interested, you can view the source in their GitHub repository.

Page last edited March 08, 2024

Text editor powered by tinymce.

Power Requirements Wiring 128x64 OLEDs Related Guides CircuitPython Hardware: SSD1306 OLED Display By Tony DiCola intermediate I2C Addresses and Troublesome Chips By lady ada beginner SSD1306 OLED Displays with Raspberry Pi and... By Tony DiCola beginner Your browser does not support the video tag. This links to the guide MIDI for Makers. MIDI for Makers By Liz Clark beginner Huzzah Weather Display By Andy Doro intermediate Using the TRRS Trinkey as an Assistive Technology... By Chris Young beginner OLED TRON Clock By Dan Malec intermediate Monitor Your Greenhouse with a No-Code Environmental... By Brent Rubell beginner Your browser does not support the video tag. This links to the guide Steampunk Cameo Necklace with OLED Display. Steampunk Cameo Necklace with OLED Display By Leslie Birch intermediate Generating Text with ChatGPT, Pico W & CircuitPython By Jeff Epler beginner Your browser does not support the video tag. This links to the guide Adafruit OLED Displays for Raspberry Pi. Adafruit OLED Displays for Raspberry Pi By M. Timmons-Brown beginner USB MIDI Keyset Controller By Ruiz Brothers intermediate Your browser does not support the video tag. This links to the guide Pico W HTTP Server with CircuitPython. Pico W HTTP Server with CircuitPython By Liz Clark intermediate Adafruit 2.8" and 3.2" Color TFT Touchscreen... By lady ada beginner Adafruit RS232 Pal By Liz Clark intermediate
Create Wishlist
× Title Description Close Search Search
Categories

Tag » Arduino Oled I2c Tutorial