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

    EXTIO2 with three UltrasoundIO connected

    UiFlow 2.0
    2
    5
    401
    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.
    • O
      oracle_sod
      last edited by

      Hi all,

      I'm fairly new to UiFlow however I have been C++ coding with Arduino for a while now and though I would try using the M5Stack gear.

      I purchased a Core device, a EXTIO2 and a number of UltrasoundIO (GPIO model). I want to build a test that reads the distance from the UltrasoundIO connected to the EXTIO2, however im not sure how to reference the pins within the EXTIO2 in the UltrasoundIO configuration or methods

      Can anyone assist or provide a basic example ?

      felmueF O 2 Replies Last reply Reply Quote 0
      • felmueF
        felmue @oracle_sod
        last edited by

        Hello @oracle_sod

        Note: I don't have the UltrasonicIO unit so my conclusions might be inaccurate.

        Looking at the Arduino code, I see it uses a function called pulseIn() which does some sort of timing. I doubt it exists on the EXTIO2 unit so you would have to emulate this functionality yourself.

        BTW: I think an easier setup would have been a PaHub unit with three Ultrasonic (I2C variant) units connected to it.

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        O 1 Reply Last reply Reply Quote 0
        • O
          oracle_sod @felmue
          last edited by

          @felmue said in EXTIO2 with three UltrasoundIO connected:

          PaHub

          1 Reply Last reply Reply Quote 0
          • O
            oracle_sod @oracle_sod
            last edited by

            (sorry about the double post)

            I'm not able to use the I2C variant as i didn't get that sensor from M5stack, its one of these:
            https://www.dfrobot.com/product-1935.html

            I need it to be water resistant for this setup.

            felmueF 1 Reply Last reply Reply Quote 0
            • felmueF
              felmue @oracle_sod
              last edited by

              Hello @oracle_sod

              ok, I see, the DFRobot version has an UART interface. M5ExtIO2 GPIOs can be set to multiple modes (input, output, ADC, servo, neopixel and PWM) but I am afraid none of these modes can be used for an UART connection.

              According to the wiki page RX is used to select the mode, this could be achieved via M5ExtIO GPIO set as output.

              However the TX line sends data with 9600 Baud, which I doubt M5ExtIO2 can handle.

              That said, what is the reason you don't connect all three Ultrasound units directly to the M5Core? That would require 6 GPIOs.

              And if you could live with the fact that all three Ultrasound units use the same mode you could get away with only 4 GPIOs, 1 GPIO to select the mode for all three units, and 1 GPIO for each unit to receive the UART data.

              Thanks
              Felix

              GPIO translation table M5Stack / M5Core2
              Information about various M5Stack products.
              Code examples

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