Set Pin A6 High (Arduino Nano)

Hi,

is it possible to set Pin A6 High on the Arduino Nano Board?

I want to do this in the same way I did with the other Pins

pinMode(A6, OUTPUT);
digitalWrite(A6, HIGH);

Why doesn´t this work?

A6 is a dedicated analog input; it is one of the (very few) pins on the ATMega328P microcontroller that can't be used as GPIO (digital input/output).

See here: http://www.atmel.com/Images/8271S.pdf and look at section 1.1.9 for more information.

If you need additional GPIO, you may want to look into using a shift register, such as a 74HC595.

A6 and A7 are connected to the ADC input multiplexer only, not to any of the digital I/O ports.

PORTC, the I/O port used for pins A0..A5 also interfaces to the RESET pin (if the chip is programmed in a particular way), so its not available for supporting two more pins. The Arduino setup keeps things simple and only supports the RESET pin as a reset input.

More details available on the ATmega328 datasheet. [ a lot more details! ]