I am using Intel Galileo Gen2 Board to display the distance measured by HC-SR04 ultrasonic module. I used the following code:
const int TrigPin = 8;
const int EchoPin = 9;
dist =pulseIn(EchoPin, HIGH,5000) / 58.0;
The output is getting hanged after few readings. Any Suggestions? If I reprogram the process repeats.
There are several threads on this issue (I've not tested them, and I've not used this specific sensor), please take a look and let us know your results: