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

    How to use both 2 I2C interface on StickC-Plus2?

    Scheduled Pinned Locked Moved PRODUCTS
    2 Posts 2 Posters 1.7k 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.
    • 俺 Offline
      俺がガンダムだ
      last edited by

      Env PlatformIO

      platformio.ini:

      ...
      platform = espressif32
      board = m5stick-c
      framework = arduino
      ...
      lib_deps =
      	Wire
      	m5stack/M5Unified
      	m5stack/M5Unit-DDS
      

      Question:

      I connect 2 modules to StickC-Plus2, one on 'grove' port, the other on 'Ext.8-pin'. Is it correct to connect this way( or to say, is it possible to communicate with 2 modules through I2C separately through GPIO25-GPIO26 and GPIO32-GPIO33)? If this is correct, then how should I write the code?

      Currently in my code, I defined the second 'TwoWire' object and initialized a module with it, but communication failed, while default 'TwoWire(0)' works well.

      TwoWire I2C_DDS = TwoWire(1);
      
      ...
      	I2C_DDS.begin(DDS_SDA, DDS_SCL);
      	dds.begin(&I2C_DDS);
      ...
      
      1 Reply Last reply Reply Quote 0
      • kurikoK Offline
        kuriko
        last edited by

        @俺がガンダムだ
        Look at the definition of TwoWire, number should be fixed

        Good morning, and welcome to the Black Mesa Transit System.

        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