[Fixed] Scanning the i2c ports on the camera.

  • First of, I am lost and utterly confused.
    I am trying to run the following code

    void setup()

    while (!Serial); // Leonardo: wait for serial monitor
    Serial.println("\nI2C Scanner");

    void loop()
    byte error, address;
    int nDevices;


    nDevices = 0;
    for(address = 1; address < 127; address++ )
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    error = Wire.endTransmission();

    if (error == 0)
      Serial.print("I2C device found at address 0x");
      if (address<16) 
      Serial.println("  !");
    else if (error==4) 
      Serial.print("Unknown error at address 0x");
      if (address<16) 

    if (nDevices == 0)
    Serial.println("No I2C devices found\n");

    delay(5000); // wait 5 seconds for next scan

    Serial monitor reports -

    No I2C devices found

    I think this is because its not looking at the correct pins.

    How do I get this to work on the esp32?

  • Switched to debug mode and now get

    [V][esp32-hal-i2c.c:693] i2c_isr_handler_default(): AcK Err errorByteCnt=1, errorQueue=0 queuepos=0

    No information from google except that its to do with the Ack bit

  • OK, found an error on the prams card.
    SDA and Vsinc are both assigned to G22
    Soic and SCL assigned to G23

    How do I access the MPU6050 and BME280?

  • hello, the old camera version's IP5306 maybe connect to I2C, maybe confused. so if u need to use I2C, you should cut the sda/scl pin 0_1538192027124_f49fff66-59d8-413e-9629-60ed4cd885a6-image.png of IP5306.

Log in to reply

Looks like your connection to M5Stack Community was lost, please wait while we try to reconnect.