🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Ultrasonic I2C problems

    Units
    1
    2
    3.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      ispybadguys
      last edited by

      I have a problem with the I2C version of the Ultrasonic distance measuring unit. If I connect it together with the MLX90640 Thermal Camera Unit the Camera data is corrupted. If I load and run the Demo and only connect the Ultrasonic distance measuring unit every other sample has the distance 4500mm. If I use this code it works fine in the demo but still corrupts the Thermal camera

      uint32_t data;
      Wire.beginTransmission(0x57); // Transfer data to 0x57.
      Wire.write(0x01);
      Wire.endTransmission(); // Stop data transmission with the Ultrasonic Unit.
      delay(120);
      Wire.requestFrom(0x57,3); // Request 3 bytes from Ultrasonic Unit.
      data = Wire.read();data <<= 8;
      data |= Wire.read();data <<= 8;
      data |= Wire.read();

      1 Reply Last reply Reply Quote 0
      • I
        ispybadguys
        last edited by

        It seems if I set the i2c rate to 100Khz this works.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post