I recently bough this tiny OLED display for my project from RhydoLabz. Board has a 6 pin interface. I initially confused the interface with an I2C interface and tried a lot of options which didn’t work.
I checked RhydoLabz website which said it is 4-wire SPI ready and needs to be tweaked for I2C interfacing. That confused me more since I am used to MOSI/MISO/SCK naming and those were not here.
I checked the data sheet to find that pin marked SCL is D0 and SDA is D1, while CS is grounded and hence not available.
The following configuration worked for me with SSD1306_128x64_spi example
Using Software SPI #define OLED_MOSI 9 // SDA #define OLED_CLK 10 // SCL #define OLED_DC 11 // DC #define OLED_CS 12 // Ignore, it is already grounded #define OLED_RESET 13 // RES
and the following for H/w SPI
Using Hardware SPI #define OLED_MOSI 11 // SDA #define OLED_CLK 13 // SCL #define OLED_DC 6 // DC #define OLED_CS 7 // Don't use this pin, used by code #define OLED_RESET 8 // RES
You still need the same Adafruit_SSD1306 and Adafruit_GFX libraries. And, if you are using 128×64 display, don’t forget to uncomment #define SSD1306_128_64 in Adafruit_SSD1306.h