Hc-sr04 witz grove connector and seeeduino v4.2?

Hi



All in the title. Is it possible to plug and use an ultrasonic sensor HC-SR04 with grove connector and a seeeduino. This broad has 3 grove connector. Or do I use a grove shield ?



So? Thanks!

Vince

Hi Vince



You can use the I2C port, they are A4/A5. The analog pins can be used identically to the digital pins, using the aliases A0 (for analog input 0), A1, etc. For example, the code would look like this to set analog pin 0 to an output, and to set it HIGH:



pinMode(A0, OUTPUT);

digitalWrite(A0, HIGH);



you can use the <LINK_TEXT text=“https://www.seeedstudio.com/Grove-4-pin … -PAck.html”>https://www.seeedstudio.com/Grove-4-pin-Female-Jumper-to-Grove-4-pin-Conversion-Cable-5-PCs-per-PAck.html</LINK_TEXT> to transform grove port to 2.54 pin connectors. then you can connect to gnd/vcc/trig/echo. thanks.