Pages: [1]   Go Down
Author Topic: Sonar range finders in ANALOG input pins or DIGITAL pins?  (Read 714 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1018
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Toledo, OH
Offline Offline
God Member
*****
Karma: 36
Posts: 510
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Arduino - Teensy - Raspberry Pi
My libraries: NewPing - LCDBitmap - toneAC - NewTone - TimerFreeTone

Pages: [1]   Go Up
Jump to: