Distance ultrasonic sensor hc-sr04

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.

then

wget http://nvhs.xoom.it/distance.py

chmod 777 distance.py

sudo ./distance.py

It is so accurate.

I’m writing a C code

Lascia un commento

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione / Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione / Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione / Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione / Modifica )

Connessione a %s...