Can I use all the Analog Pins of arduino nano as Digital

Dear Team,

I would like to know whether I can use all analog pins of Arduino nano(A0 to A7) as digital.

Arduino pin information page says as

The analog pins can be used identically to the digital pins, using the aliases A0 (for analog input 0), A1, etc. For example, the code would look like this to set analog pin 0 to an output, and to set it HIGH:

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

regards
HAri

No, only A0 to A5 can be used as digital pins
See digitalRead() - Arduino Reference

The analog input pins can be used as digital pins, referred to as A0, A1, etc. The exception is the Arduino Nano, Pro Mini, and Mini’s A6 and A7 pins, which can only be used as analog inputs.

1 Like

Thank you :smiley: