IR distance sensor and Arduino

Playing with the Arduino a bit again tonight. Here’s a snippet (source) to read the analog output from a Sharp GP2D12 analog distance sensor and convert it to centimeters:
Seems to work reasonably well.

Playing with the Arduino a bit again tonight. Here’s a snippet (source) to read the analog output from a Sharp GP2D12 analog distance sensor and convert it to centimeters:
Seems to work reasonably well.