I’ve trying to get my OLED via SPI to work, but these pins are very confusing to me.
To the left is what my OLED reads, and on the right is the pins I’ve tried to use on my Electron
Data - D2
Clk - D4
DC/SA0 - D1 (?)
Rst - D6 (guess this can be any output pin?)
CS - D5
3v3 - 3V3
Vin - empty
Gnd - Gnd
Where do I go wrong? I’m interpreting the Data pin on the OLED to be the MOSI, and the DC/SA0 I’m not really sure about…
I’m using the Adafruit_ssd1306 library, with these commands:
#define OLED_MOSI D2 #define OLED_CLK D4 #define OLED_RESET D6 #define OLED_CS D5 #define OLED_DC D1 Adafruit_SSD1306 oled(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS); // Doesn't work //Adafruit_SSD1306 oled(OLED_DC, OLED_RESET, OLED_CS); // Doesn't work either
The code compiles and all. I’m using the same code I’ve been running but on an I2C OLED, so I figure the code itself does not need any change apart from the parts above.