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

    M5Atom I2c

    Scheduled Pinned Locked Moved Cores
    2 Posts 1 Posters 5.3k Views 1 Watching
    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.
    • M Offline
      Michael1968
      last edited by

      Hi all,
      i'm playing with the mpu6886, with the Arduino lib i can read it.
      how can i use the "grove" connector (g26,g32) with a i2c device at the same time?

      thx Michael

      1 Reply Last reply Reply Quote 0
      • M Offline
        Michael1968
        last edited by

        ok...i find out that i have to use SoftwareI2c and the i2c device must have pullup resistors:

        #include "SoftwareI2C.h"

        SoftwareI2C softwarei2c;

        void setup() {
        Serial.begin(115200);
        softwarei2c.begin(26, 32); // sda, scl
        Serial.println("begin to scan...");
        }

        void loop() {
        for (unsigned char i = 1; i <= 127; i++) {
        if (softwarei2c.beginTransmission(i)) {
        Serial.print("0x");
        Serial.println(i, HEX);

                while (1);
            }
            softwarei2c.endTransmission();
        }
        
        Serial.println("find nothing");
        while (1);
        

        }

        1 Reply Last reply Reply Quote 0

        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