What you may not realize is that the AVR chips used on the Arduino boards
don't have any analog output capabilities.
Some pins can be digital outputs or analog inputs.
Some pins can be digital outputs but also support PWM modulation output.
The pins used for analog on the AVR are only for analog input.
The A6 and A7 pins can only be analog inputs.
The IDE routine analogWrite() was a VERY BAD name.
There is no analog output involved at all.
analogWrite() does a PWM modulation output on a digital pin.
In fact if you look at the pin arguments used for analogRead() and analogWrite() they
don't even take the same arguments.
analogRead() wants an analog pin number while analogWrite() wants a digital pin number.
In my opinion this was a huge screwup in the API as it is a huge inconsistency.
--- bill