Go Down

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


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


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


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 will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131