https://www.adafruit.com/product/4741
I'm using ESP32 Feather V2. Sample for Arduino does not work - "Unable to initialize OLED"
Address is correct and ESP32 surely has enough memory
I thought it is broken but purchased second one and it behaves exactly the same.
I started messing with I2C scan.
Now there is a strange part.
When I added Wire1 to I2C scan and execute it before calling OLED begin then it works.
Even though Wire1 scan displays errors.
Any idea what is going on and hot wo properly initialize it without this scan?
Scan:
Code: Select all
extern Adafruit_TestBed TB;
#define DEFAULT_I2C_PORT &Wire
#define SECONDARY_I2C_PORT &Wire1
void ScanI2C() {
Serial.print("Default port (Wire) ");
TB.theWire = DEFAULT_I2C_PORT;
TB.printI2CBusScan();
#if defined(SECONDARY_I2C_PORT)
Serial.print("Secondary port (Wire1) ");
TB.theWire = SECONDARY_I2C_PORT;
TB.printI2CBusScan();
#endif
}
Code: Select all
Default port (Wire) I2C scan: 0x0, 0x18, 0x70,
Secondary port (Wire1) [ 265][E][Wire.cpp:77] initPins(): no Default SDA Pin for Second Peripheral
I2C scan: [ 265][E][esp32-hal-i2c.c:142] i2cWrite(): could not acquire lock
[ 269][E][esp32-hal-i2c.c:142] i2cWrite(): could not acquire lock
[ 275][E][esp32-hal-i2c.c:142] i2cWrite(): could not acquire lock
[ 281][E][esp32-hal-i2c.c:142] i2cWrite(): could not acquire lock
[ 287][E][esp32-hal-i2c.c:142] i2cWrite(): could not acquire lock
...
Display initialized