The WeMosBat pinout has no SDA or SLC pins. ESP32 standard are GPIO 21 and 22.
I’m trying to get the integrated OLED to work, but the example I have is for a previous version.
The factory program was running the OLED, so I know it works.
An I2C scan reveals zero devices.
It’s supposed to BE the SSD 1306. I can code the display, but I guess I’m guessing now.
This is the exanple’s declaration:
#include “SSD1306.h” // alias for `#include “SSD1306Wire.h”’
// Initialize the OLED display using Wire library
SSD1306 display(0x3c, 5, 4);
display.init();
This is what I’m used to, what I wrote in:
Adafruit_SSD1306 display(0x3c, 5, 4);
Wire.begin();
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //Start the OLED display
Any suggestions?
Any idea what pins the OLED is on?
I repeated with declarations for SDA and SLC at 21 and 22, and 22 and 21. Did the same with 4 and 5, because that’s in the example declaration. And 5 and 4.
This is the I2C scanner, unchanged from Random Nerd:
/*********
Rui Santos
Complete project details at https://randomnerdtutorials.com
*********/
#include <Arduino.h>
#include <Wire.h>
void setup()
{
Wire.begin();
Serial.begin(57600);
Serial.println("\nI2C Scanner");
}
void loop()
{
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for (address = 1; address < 127; address++)
{
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address < 16)
{
Serial.print("0");
}
Serial.println(address, HEX);
nDevices++;
}
else if (error == 4)
{
Serial.print("Unknow error at address 0x");
if (address < 16)
{
Serial.print("0");
}
Serial.println(address, HEX);
}
}
if (nDevices == 0)
{
Serial.println("No I2C devices found\n");
}
else
{
Serial.println("done\n");
}
delay(5000);
}