[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()
    {
    Wire.begin();

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

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

    Serial.println("Scanning...");

    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.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address<16) 
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");
    
      nDevices++;
    }
    else if (error==4) 
    {
      Serial.print("Unknown 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); // wait 5 seconds for next scan
    }

    Serial monitor reports -

    Scanning...
    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.




登录后回复
 

与 M5Stack Community 的连接断开,我们正在尝试重连,请耐心等待