I have am trying to get a Grove Ultrasonic Ranger to work with a Xiao ESP32-C6. I’m using the example given in the Ultrasonic Ranger Wiki. The serial data only reports “0” inches/cm. I’ve tried different bases, the Grove Expansion Board and a Grove Base. Same results. I’ve then tried using a Xiao Seeeduino and it works fine on both bases.
The only way I got it to work, was to change the data pin from 7 to 0 (using the other Grove Jack) on both the Expansion Board and Grove Base.
Is there something I’m missing in using the ESP32-C6 that doesn’t like using D7?
on this device you are going to want to use D0 grove port and use D0 as the control pin in the code
you probably dont want to use D7… as 6&7 is for serial UART port and may cause confusion
you really dont want to use the top two grove ports, because they are both IIC ports and are connected internally to the screen and RTC… so it is not going to work because of cross talk with the hardware
on this device… theoredically any pin can work… the upper left port is D0
also here the IIC ports are connected internally… so you can only use one or the other but not both at the same time… if you are not using other IIC devices on this bus… and also D7 UART can be used… but i say avoid that one too if possable
as you can see… the third pin (white wire) is NC Not Connected to anything… so make sure whatever port you use… the outboard pin (Yellow Wire) is the pin which will send and recieve the signal
I would only add this: Sometimes the GPIO pin number needs to be used instead of the logical pin(D7) try that with the Xiao side and What BSP are you using? some are buggy on Serial port pins support.
HTH
GL PJ
@cgwaltney recommends are spot on as well any pin should work.
I tried on both of the Grove boards that you pictured. Both act the same when using the ESP32-C6. I too suspected the UART wasn’t playing nicely so I tried moving to a different output pin (D0 in my case, was the only one that worked). I just found it odd that the Seeduino (SAMD) had no such issues using D7. I have a feeling that there’s something going on with the pin-muxing in the ESP that is at fault, but I’m not an computer engineer, which is