Function microsecondsToInches()

Is there an inbuilt function microsecondsToInches() in the arduino environment? i was tring to use the cide suggested at "" but i receive the following error.

In function 'void loop()': error: 'microsecondsToInches' was not declared in this scope

. I wanted read values from PING))) ultrasonic range finder and try converting the value to inches. Is there anyone with the function to assist me with it?

It's a code function you have to add into your sketch. It's shown in that link you provided:

long microsecondsToInches(long microseconds)
  // According to Parallax's datasheet for the PING))), there are
  // 73.746 microseconds per inch (i.e. sound travels at 1130 feet per
  // second).  This gives the distance travelled by the ping, outbound
  // and return, so we divide by 2 to get the distance of the obstacle.
  // See:
  return microseconds / 74 / 2;


Oh! Thanks, I had not see this part. My sketch is working ok now!!