Go Down

Topic: Analog to digital pin (Read 2080 times) previous topic - next topic

Hi
I read somewhere that you could use analog pins as digital ones on the arduino uno, how would this be done?

PGT

just as you would configure a normal pin for digital input or output in the setup part..

MarkT

On the Uno the analog pins can be referred to as A0, A1, ..., A5 (or equivalently as 14, 15, ... 19) in calls to digitalRead/Write/pinMode and analogRead.

You can also use the short cut values 0, 1, ..., 5 only in calls to analogRead () which assumes you mean an analog pin.

The Arduino Mega has different pin numbers, note.
[ I won't respond to messages, use the forum please ]

Go Up