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

    Ultrasonic I2C problems

    Scheduled Pinned Locked Moved Units
    2 Posts 1 Posters 3.8k Views
    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 Offline
      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 Offline
        ispybadguys
        last edited by

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

        1 Reply Last reply Reply Quote 1

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post