HCSR04Ultrasonic

This library can be used to read data from the HCSR-04 ultrasonic sensor.

Features

There are five methods in the Ultrasonic class.

  1. Ultrasonic::CM and Ultrasonic::IN are static const class member objects on the Ultrasonic class.

  2. long timing() This method reads data from the sensor. The return value is used for the microsec argument to the next method described below.

  3. long convert(long microsec, int metric) This method converts the microsecond output of timing() passed to microsec to either centimeters or inches. The metric argument can be either of the two member object discribed in 1 above.

  4. bool sampleCreate(size_t size, ...) This method sets up the buffer(s) needed to derive the standard deviation. The size argument is the number of buffers that you will need. For each buffer, you need to pass an additional argument indication the length of that buffer. ex. bool success = sampleCreate(3, 10, 15, 8) This indicates that there will be three buffers each with lengths of 10, 15, 8 respectively.

  5. void sampleClear()

  6. float unbiasedStdDev(long msec, size_t bufNum) This method