Ich habe mir mal so ein Dingens geholt. Schön kompakt, gefällt mir.
Vorteil: OLED ist gleich eingebaut - somit weniger Verdrahtungsaufwand
Nachteil: Das OLED ist über SPI angeschlossen und belegt daher ein paar mehr Pin`s
Eine entsprechende Bibliothek muss in die IDE eingebunden werden - steht alles hier.
Aber aufgepasst!
In den Beispielsketchen muss SDA & SCL auf D1 und D2 angepasst werden:
....
// Initialize the OLED display using Wire library
SSD1306Wire display(0x3c, D1, D2);
....
Stimmt!
Das sollte dann per I2C angeschlossen sein. Umso besser: Mehr Pin’s frei.
Die Beispiele scheinen auch für andere Anschlussvarianten gemacht zu sein.
// Include the correct display library
// For a connection via I2C using Wire include
#include <Wire.h> // Only needed for Arduino 1.6.5 and earlier
#include "SSD1306Wire.h" // legacy include: `#include "SSD1306.h"`
// or #include "SH1106Wire.h", legacy include: `#include "SH1106.h"`
// For a connection via I2C using brzo_i2c (must be installed) include
// #include <brzo_i2c.h> // Only needed for Arduino 1.6.5 and earlier
// #include "SSD1306Brzo.h"
// #include "SH1106Brzo.h"
// For a connection via SPI include
// #include <SPI.h> // Only needed for Arduino 1.6.5 and earlier
// #include "SSD1306Spi.h"
// #include "SH1106SPi.h"
// Use the corresponding display class:
// Initialize the OLED display using SPI
// D5 -> CLK
// D7 -> MOSI (DOUT)
// D0 -> RES
// D2 -> DC
// D8 -> CS
// SSD1306Spi display(D0, D2, D8);
// or
// SH1106Spi display(D0, D2);
// Initialize the OLED display using brzo_i2c
// D3 -> SDA
// D5 -> SCL
// SSD1306Brzo display(0x3c, D3, D5);
// or
// SH1106Brzo display(0x3c, D3, D5);
// Initialize the OLED display using Wire library
SSD1306Wire display(0x3c, D3, D5);
// SH1106 display(0x3c, D3, D5);