Lolin ESP32 to 7 pin SPI Oled

EthanJappie
Posts: 1
Joined: Mon Jan 16, 2023 6:10 am

Lolin ESP32 to 7 pin SPI Oled

Postby EthanJappie » Mon Jan 16, 2023 8:34 am

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 1648 times
Any help would be greatly appreciated as I have been struggling for hours with no progression.

Thanks,
Ethan

polyakbalazs
Posts: 8
Joined: Thu Feb 09, 2023 3:09 pm

Re: Lolin ESP32 to 7 pin SPI Oled

Postby polyakbalazs » Fri Feb 10, 2023 10:17 am

You should use SPI pins, which is on 18 19 23 pins. (On the right side, in light blue background)

Who is online

Users browsing this forum: No registered users and 174 guests