Pages: [1]   Go Down
Author Topic: Mega 2560 digital pin number of the analog pins  (Read 1649 times)
0 Members and 1 Guest are viewing this topic.
Howell, Mi
Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all!

Does anyone know what the digital equivalent of analog pins 0-15 on a Mega 2560 is? I need some more digital pins and I know that on the Uno, analog pins 0-5 are digital 14-19. So is there something similar on the Mega?

Thanks!
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17293
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all!

Does anyone know what the digital equivalent of analog pins 0-15 on a Mega 2560 is? I need some more digital pins and I know that on the Uno, analog pins 0-5 are digital 14-19. So is there something similar on the Mega?

Thanks!

You do know that you can just use the analog pin name in a digital statement, as in
digitalWrite(A0, HIGH); pinMode(A0, OUTPUT); That works for both a Uno and Mega board without having to remember what the digital pin name is for the same physical pin.

But if you do want the digial alias name for the analog pin numbers then this doc should help. Arduino digital pin names are is the far left column.

https://spreadsheets.google.com/pub?key=rtHw_R6eVL140KS9_G8GPkA&gid=0

Lefty
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

are you saying that for example if Im using digital pin 5 and also analog pin 5 I can just say : pinMode(A5,INPUT); pinMode(5,OUTPUT);
this would be great. also one way to find out whats the equivalent digital pin for an analog pin is for example on mega we have 53 digital pins so analog pin 0 is 54,  just add whatever pin number to 53. and on uno we have 13 digital pins so analog 0 is 14..
Logged

Pages: [1]   Go Up
Jump to: