Arduino Playground is read-only starting December 31st, 2018. For more info please look at this Forum Post

Ultrasonic SR04 library for Arduino
by Ashish Rajput - 2012

CURRENT VERSION

Release 2.0 24-April-2012 beta version.

HISTORY

Release 1.0 24-April-2012 Initial Release

DESCRIPTION

Easy to use ultrasonic library based on HC-SR04 sensor. This simple library uses delay. don't use this if your sketch require no delay.

HOW TO IMPORT/INSTALL

Download here: Download zip file here

Put the Logging folder in "libraries\".

Open example project which is included in the zip file. Try it, like it :-)

Detailed description is included in doc folder

Methods for measuring

MethodeComment
Range()!Returns the distance in CM
Time()! Returns the time in us for To and Fro Cycle