Pages: [1]   Go Down
Author Topic: Analog to digital pin  (Read 1600 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Full Member
***
Karma: 2
Posts: 212
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Shannon Member
****
Karma: 160
Posts: 10416
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

[ I won't respond to messages, use the forum please ]

Pages: [1]   Go Up
Jump to: