When I’m defining my pins, what number do I use for the analog pins? Would I use ‘A0’ or ‘15?’
No. The analog pin numbering starts at 0, just like the digital pins.
The A0, A1, A2, etc. aliases are defined for when the analog pins are being used as digital pins.
Not quite. The analog pins (talking the Uno etc here) are numbered 14 and up, which have aliases A0…A7.
Just for the purposes of analogRead there are also aliases 0…5 which refer to the analog pins, but its perfectly
fine to use A0…A7 or 14…21 as an argument to analogRead().
The source code is the place to check this sort of detail, specifically the files
BTW analogWrite() only works on the PWM pins which are 3,5,6,9,10,11 on the Uno. This is not
actually analog output.
[and pins A6 and A7 are only available on some boards and are not digital capable pins, they only