reference-en icon indicating copy to clipboard operation
reference-en copied to clipboard

Reference missing mention of constants A0, A1, ...

Open NeatNit opened this issue 8 years ago • 3 comments

As I mentioned along with some other stuff on the forum, the analog input pin constants are not mentioned in the Arduino reference - not under Constants and not in analogRead.

But actually, I'm unclear on how they are used. I have an Uno and the constant A0 has the value 14. The example AnalogReadSerial uses this constant to read the value: int sensorValue = analogRead(A0); However, the analogRead reference page says:

pin: the number of the analog input pin to read from (0 to 5 on most boards, 0 to 7 on the Mini and Nano, 0 to 15 on the Mega)

So which is it? Is the reference page plain wrong, or are A0 and 0 equivalent for analogRead?

NeatNit avatar May 14 '17 15:05 NeatNit

analogRead supports two argument values: The analog channel number (0-something), or the pin number (e.g. 14+ on a Uno) that can also be passed to digitalWrite. Does that clarify?

matthijskooijman avatar May 14 '17 16:05 matthijskooijman

Yes, thank you... though pert has already clarified this on the forum.

NeatNit avatar May 14 '17 17:05 NeatNit

not in analogRead.

This issue was fixed by https://github.com/arduino/reference-en/pull/463

the analog input pin constants are not mentioned in the Arduino reference - not under Constants

This issue remains.

per1234 avatar Oct 20 '20 23:10 per1234