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

    M5Atom I2c

    Cores
    1
    2
    4.6k
    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
      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
        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
        • First post
          Last post