Hello,
I ordered an ESP32 board with a built-in OLED.
It hasn't arrived yet. Does anyone know this board?
https://de.aliexpress.com/item/10050073 ... pt=glo2deu
Can it be controlled with the Arduino software?
Does anyone have a sample code?
Thank you very much.
Hans
Question about Board with built in Oled?
-
ahsrabrifat
- Posts: 201
- Joined: Sat Jan 18, 2025 2:31 pm
Re: Question about Board with built in Oled?
For boards like the WeMos Lolin32 OLED, the built-in OLED uses GPIO 5 (SDA) and GPIO 4 (SCL), not the ESP32's default I²C pins (21 & 22)
Your code should explicitly set up I²C to use the board's pins:
Your code should explicitly set up I²C to use the board's pins:
Code: Select all
#include <Wire.h>
Wire.begin(5, 4); // SDA = 5, SCL = 4
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
void setup() {
Wire.begin(5, 4);
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C, false, false)) {
Serial.println(F("OLED init failed"));
while (1);
}
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0,0);
display.println("Hello, ESP32 OLED!");
display.display();
}
void loop() {
}
Who is online
Users browsing this forum: ChatGPT-User and 3 guests