Sonar range finders in ANALOG input pins or DIGITAL pins?

Hello everyone,

I have been ask to extend a robot project which was previously designed by someone else.

I have been following some tutorials on the net, it seems most of people uses digital pins to connect ultrasonic range finders. but, in this robot these sonar sensors are connected to pins 3 and 4 analog Input.

I was wondering which one is the best approach and what is the difference.

I do appreciate your time answering my questions.

Thank you very much

If you have this: http://arduino.cc/en/Tutorial/Ping?from=Tutorial.UltrasoundSensor than the output signal of the sensor is digital.
Every analog input can also be configured as an digital input or output.

Farhad:
Hello everyone,

I have been ask to extend a robot project which was previously designed by someone else.

I have been following some tutorials on the net, it seems most of people uses digital pins to connect ultrasonic range finders. but, in this robot these sonar sensors are connected to pins 3 and 4 analog Input.

I was wondering which one is the best approach and what is the difference.

I do appreciate your time answering my questions.

Thank you very much

Since both pins are attached to analog pins, it sounds like the project just used the analog pins because they ran out of digital pins. Analog pins can be used as digital pins, which is probably causing the confusion.

We would need to know the model of the sensor to tell you for sure.

Tim