Cannot use analogue pins as digital

Hello there
I saw an 8-year-old post that has now closed: Problem using Analog pins as Digital outputs
I have the same problem. (elegoo nano board, IDE 1.8.11)
Please advise on what is the best way to get some help on this, can we open the old thread or start afresh with this? FYI I have exactly the same issue as the original poster. Only A0 from the analogue pins works as a digital output.

Which particular problem?
How does it manifest itself?

I try to set analgoue pins (A6) high. A6 does not go high. The built in LED goes high. But none of the analogue pins EXCEPT A0


// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(A6, OUTPUT);

// the loop function runs over and over again forever
void loop() {
digitalWrite(A6, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(LED_BUILTIN, HIGH);
delay(2000); // wait for a second
digitalWrite(A6, LOW); // turn the LED off by making the voltage LOW
digitalWrite(LED_BUILTIN, LOW);
delay(2000); // wait for a second

Are you sure you measure it on the correct pin? I’ve seen people making mistakes by counting pins on the board to find the pin

A6 and A7 on an nano ( they don't exist on an UNO ) are pure analog pins and cannot be used as digital pins. Only A0-A5 can be used as digital pins.

1 Like

Look here and you'll see A6 and A7 are analog inputs only:

(select the Documentation tab to see the diagram)


Nano Every?

correct, mine was nano every for some reason

Thank you guys , I had a slightly different pinout. But the snip above is from Arduino Nano | Arduino Official Store.

and the PCB is already made !!!! the only two analgue pins that cannot be used as outputs, and I routed them as outputs . :100:

change to nano every

Yeah, the situation is different with the Nano Every. You can use those two pins for outputs because it uses the ATmega4809 microcontroller instead of the classic Nano's ATmega328P:

Nano every £11.6
Elegoo Nano £3

cheaper to redo pcb? anyway, nano every is a better and more powerful board.

1 Like

And a corresponding price tag.

Suck it up! :grin: What else would you expect?

1 Like

@kolm1982 Your Elegoo Nano is a totally different board than the Nano Every. They have nothing in common.
Okay, they both use a microcontroller from the AVR family.

Your Elegoo Nano is a clone of a Arduino Nano. It can not use A6 and A7 as digital outputs.

If you can replace your Nano with a Nano Every, that would be a good solution. I did not check if your Elegoo Nano clone is pin-compatible with the Nano Every.

1 Like