EXTIO2 with three UltrasoundIO connected
-
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 ?
-
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 -
@felmue said in EXTIO2 with three UltrasoundIO connected:
PaHub
-
(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.htmlI need it to be water resistant for this setup.
-
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