SONAR Pmod controler

The module described here makes it possible to retreive the distance detected by the proximity detector PmodSONAR.

( figure source)


This module constantly outputs the distance measured by the SONAR Pmod. The output value (data_out) roughly changes each 49ms and is always valid. It represents the distance beween the SONAR Pmod and the closest obstacle expressed in inches (2.54cm). data_out is 8 bits unsigned, so the maximal measurable distance is 255in.

If the obstacle is closer than 6in, the Pmod output is unstable and meaningless (generally equal to 5 or 6)