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

    Ultrasonic I2C module and using port B and Port C on Core2 for AWS with the included library

    Modules
    3
    4
    396
    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.
    • T
      tdahbura
      last edited by

      I have an Ultrasonic I2C module and am trying to use it with the AWS Core 2 device. It works fine on port a, but am trying to use port b or port c for the I2C commications. I am using the Arduino development environment and the code in place that works with port a is this:

      SONIC_I2C sensor;
      
      sensor.begin(); 
      newvalue = sensor.getDistance(); //this is returned in mm
      CoreS3.Lcd.printf("%.2f mm", newvalue);
      

      I do not know how to do the same with the sensor plugged into Port B or Port C?

      thanks for any assistance!

      teastainT ajb2k3A 2 Replies Last reply Reply Quote 0
      • teastainT
        teastain @tdahbura
        last edited by teastain

        @tdahbura Deleted previous post with assertions that did not pan out in my tests!
        Sorry

        Cheers, Terry!

        100% M5Stack addict with several drawers full of product!

        1 Reply Last reply Reply Quote 0
        • ajb2k3A
          ajb2k3 @tdahbura
          last edited by

          @tdahbura You cant use it on port B because the port has one hardware fixed output pin and one hardware fixed input pin.
          Port C is attached to dedicated UART pins.
          For port B you need the PortB version of the sensor or use a the PaHub .

          UIFlow, so easy an adult can learn it!
          If I don't know it, be patient!
          I've ether not learned it or am too drunk to remember it!
          Author of the WIP UIFlow Handbook!
          M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

          T 1 Reply Last reply Reply Quote 0
          • T
            tdahbura @ajb2k3
            last edited by

            @ajb2k3 thanks.

            I did not there was a different port version of the sensor?

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