Opening the file with a text editor such as the Arduino IDE gives (scroll down as shown): Note that the Adafruit SSD1306 OLED driver supports 3 types: 128×64, 128×32 and 96×16 pixel, we can select between them in the driver file Adafruit_SSD1306.h. Note that resistance of R1 = R3 = R8 = 0 ohm.Īdafruit Industries provides a very nice library for the SSD1306 OLED, it can be easily installed using Arduino library manager (Sketch -> Include Library -> Library Manager), or manually by downloading it from the link below and adding it to Arduino libraries folder (C:\Program Files\Arduino\libraries): The SSD1306 OLED which I used is shown below (back view), the default mode is SPI which can be changed to I2C by removing the resistors R3 and placing the resistors R1 & R8 (as written on the board). The SPI protocol is faster than the I2C protocol but it uses more pins: SCK, SDA, CS (chip select: active low), D/C (data/command) and a rest pin (RST).
The I2C protocol needs only 2 lines: SDA (serial data) and SCK (serial clock), an additional line is required which is a reset line (RST).
In this topic I’m going to show how to use I2C and SPI protocols with this display. The SSD1306 display contains a driver chip with the same name (SSD1306), it can communicate with the master device (microcontroller, microprocessor …) over I2C protocol, SPI protocol or 8-bit parallel protocol.