Question for wiring the SSD1306 OLD disply

I am fairly new to this.
In youtube I see majority of OLED displys having pins

  • VCC
  • GND
  • SCK
  • SDA
    In one of the tutorials they asked to connect the last two pins to A5 and A6

The disply I have however has more pins

  • VCC
  • GND
  • CLK
  • MOSI
  • RE
  • SDC
  • CS
    Can you advice how I should connect this display to arduino Nano.
    Would I still be able to use Adafruit_SSD1306 library and if so would I still be able to intialise the display in this way or do I have to do it differently
    #include <SPI.h>
    #include <Wire.h>
    #include <Adafruit_GFX.h>
    #include <Adafruit_SSD1306.h>

Adafruit_SSD1306 display(4);

void setup() {

display.begin(SSD1306_SWITCHCAPVCC,0x3C);

Any comments would be greatly appreciated

Mariusz

The OLEDs with SCL & SDA pins use i2c bus. Your display uses SPI bus. SPI bus uses more pins, but it is much faster to update the display, if you use the Arduino's SPI pins also (MOSI to pin 11, SCK to pin 13).

#define OLED_DC     6
#define OLED_CS     7
#define OLED_RESET  8
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT,
  &SPI, OLED_DC, OLED_RESET, OLED_CS);

Thank you for your response
So Would the wiring like this work

PIN Arduino Pin
CLK 12
MOSI 11
CS 8
DC 9
RES 10

So I guess my display cannot use I2C bus:(?

Ignore my previous post. I have not seen the code you pasted.
In a meantime I found some other reference which differs from the one you posted.

// If using software SPI (the default case):
#define OLED_MOSI 11 //D1
#define OLED_CLK 12 //D0
#define OLED_DC 9
#define OLED_CS 8
#define OLED_RESET 10

Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

SCK to pin 13.

It may be possible to use I2C. Post a clickable link to your display.

Software SPI is slower than i2c. I2c is slower than hardware SPI. My code was for hardware SPI.

Here is the link

In one of the tutorials they asked to connect the last two pins to A5 and A6

tutorials would never say A5, A6

Dziubym:
The disply I have however has more pins

  • VCC
  • GND
  • CLK
  • MOSI
  • RE
  • SDC
  • CS

I do not believe you. RES and DC is more common. And most are GND, VCC, CLK rather than VCC, GND, CLK

It is always wise to post a link to the item that you have bought. Then there is no confusion.

It “looks” as if you have an SPI display. If you have a Uno or Nano

// connect display pins:
#define OLED_MOSI  11
#define OLED_CLK   13
#define OLED_DC    9
#define OLED_CS    10
#define OLED_RESET 8
// first try Software SPI constructor:
Adafruit_SSD1306 display(128, 32, OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
// then try hardware SPI by using this constructor instead 
//Adafruit_SSD1306 display(128, 32, &SPI, OLED_DC, OLED_RESET, OLED_CS);

SPI is always faster than I2C.

David.

Edit. Thanks for the link. Your display is 128x32. I have corrected the constructors.

PaulRB:
Post a clickable link to your display.

Dziubym:
Here is the link
0.91 Cal SPI 128x32 biały/niebieski wyświetlacz OLED moduł diy SSD1306 sterownik ic DC 3.3 V 5 V dla Arduino PIC|module diy|ic modulemodule dc - AliExpress

That link is not clickable. Try to click it yourself.

This is a clickable link: 0.91 Cal SPI 128x32 biały/niebieski wyświetlacz OLED moduł diy SSD1306 sterownik ic DC 3.3 V 5 V dla Arduino PIC|module diy|ic modulemodule dc - AliExpress

Dziubym:
So I guess my display cannot use I2C bus:(?

Maybe not:


I cannot see what needs to be changed to make the display use i2c bus. There is "R1" and "R2", so maybe that is the way, but there are no labels to make this clear.

For comparison, look at this 128x64 SPI OLED:


There are instructions indicating which bridges to solder to change from SPI to i2c. Bridges R3 and R4 are connected and R1, R2 and R8 are not connected, so this is set for SPI. To set for i2c, R1 and R8 must be shorted (with a blob of solder) and R3 must be broken (by removing the "0" resistor).