jung6717 / arduino

Automatically exported from code.google.com/p/arduino
0 stars 0 forks source link

Add aliases for the analog input pins (A0, A1, etc.) #244

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What change would like to see?

The additions of #define's or consts for the analog input pins.  That is, A0 
would have the value 
14, A1 would be 15, etc.  Then analogRead() would take either 0 or A0, 1 or A1, 
etc.

Why?

So we can do:

digitalWrite(A0, HIGH); // enable a pullup
analogRead(A0); // read from the pin

Or, potentially (if we add it):

pullup(A0);
analogRead(A0);

Would this cause any incompatibilities with previous versions?  If so, how
can these be mitigated?

The analogRead() functions need an extra check to accept either 0 or A0, but I 
don't think it will 
hurt anything.

Original issue reported on code.google.com by dmel...@gmail.com on 6 May 2010 at 6:19

GoogleCodeExporter commented 9 years ago

Original comment by dmel...@gmail.com on 16 May 2010 at 4:06