Using Ultrasonic Sensor HC SR04 with Python



I was wondering of there is a library for this? I couldn’t find one when i searched for an ultrasound distance sensor.

Many thanks in advance!


Have you seen the community library andreabau.srf for the SRF01


No, I have not seen this, many thanks!


Okay, I’ve seen it now. The thing is that it is using a single pin sensor, and I have a sensor like


The four pins are of course Vin, Gnd, Trigger and Echo, so I was wondering if someone can help me figure out a way to modify the library for four pin operation?

Many thanks in advance!