HC-SR04 arduino codes

Hallo everyone 

I want to make a robot with the hc-sr04 ultrasonic sensor on a servo.

Can someone help me with some (example)  codes for the hc-sr04 utrasonic distance sensor?

 

 

 

I will upload some vids/pics/info about my first robot, that walks.

Edit: just neede to replace the numbers from the original ping sketch. it works now

http://fritzing.org/projects/

http://fritzing.org/projects/arduino-ultrasonic-ranging-with-hc-sr04/

and

http://www.elechouse.com/elechouse/images/product/Arduino%20Ultrasonic%20Range%20Detection%20Sensor/Arduino%20Ultrasonic%20Range%20Detector.pdf

**Thanks **

Thanks

 

Is the last part correct,

Is the last part correct, because of the warning:

// *** THIS NEEDS TO BE CHECKED FOR THE HC-SR04 ***