I have an hc-sr04 ulltrasonic distance sensor.
I find there a pyton script to use it with raspberry pi.
But thise script had some simple error.
I solved thise error and i put script there
to use thise script
Simply connect Vcc to 5v (Raspberry Pi pin 2) and GND to 0v (Raspberry Pi pin 6). Trig is connected to a GPIO output pin and Echo is connected to a GPIO input pin. In this example, I use Raspberry Pi pin 7 connected to Trig, and Raspberry Pi pin 11 connected to Echo.
chmod 777 distance.py
It is so accurate.
I’m writing a C code