Page 1 of 1

Lolin ESP32 to 7 pin SPI Oled

Posted: Mon Jan 16, 2023 8:34 am
by EthanJappie
Good Day Guys,
I need some assistance with connecting a Lolin ESP32 to a 7 pin SPI Oled display.

I am currently using the code and pin outs laid out in the code below but I just cannot get anything to display. VCC is connected to a 3.3V pin and not the 5v pin

[Codebox]
#include <SPI.h>
#include <Adafruit_SSD1306.h>

#define OLED_DC 13
#define OLED_CS 15
#define OLED_CLK 14
#define OLED_MOSI 27
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

void setup() {
Serial.begin(115200);
Serial.println("Setup");
display.begin(SSD1306_SWITCHCAPVCC);
display.display();
delay(2000);
display.clearDisplay();
display.display();
}

void loop() {
Serial.println("Loop");
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0,0);
display.println("Hello, world!");
display.display();
delay(1000);

}
[/Codebox]

I used the below pin out diagram to get the correct GPIO pins to reference in the code
ESP32.png
ESP32.png (795.75 KiB) Viewed 1431 times
Any help would be greatly appreciated as I have been struggling for hours with no progression.

Thanks,
Ethan

Re: Lolin ESP32 to 7 pin SPI Oled

Posted: Fri Feb 10, 2023 10:17 am
by polyakbalazs
You should use SPI pins, which is on 18 19 23 pins. (On the right side, in light blue background)