WeMosBat Troubles- no I2C?

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);

This is what I’m used to, what I wrote in:
Adafruit_SSD1306 display(0x3c, 5, 4);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //Start the OLED display

Any suggestions?
Any idea what pins the OLED is on?

I find nothing online.


the used Arduino variant in the ESP32 core is pocket_32 which declares

And if I look at the picture provided here the 21 and 22 pins are aceessible via the header.

Also, I don’t see an OLED on that device?

The OLED is not seen.

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()
  Serial.println("\nI2C Scanner");

void loop()
  byte error, address;
  int nDevices;
  nDevices = 0;
  for (address = 1; address < 127; address++)
    error = Wire.endTransmission();
    if (error == 0)
      Serial.print("I2C device found at address 0x");
      if (address < 16)
      Serial.println(address, HEX);
    else if (error == 4)
      Serial.print("Unknow error at address 0x");
      if (address < 16)
      Serial.println(address, HEX);
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");

This scanner doesn’t specify any pins.

So does it scan the whole board for an SDA or SCL signal it can recognize?

No, it will scan the I2C bus using the default I2C pins of the variant, aka 21 and 22, not any other pin.

Do you have a link to where you bought the device? I could not see an OLED screen in the above product page.

I got it from AliExpress. There are no attachments. Just photos.


That’s the pinout.

And right there it shows a pinout with the I2C pins…


OLED_SDA = 5 and OLED_SCL = 4.

So per above you were already right

What happens in the scanner sketch when you change

To Wire.begin(5,4);?

Aha! My pinout doesn’t have those yellows.

No I2C devices.