Arduino nano connections to analogue

Ive got a project with I2C LCD, keypad and RS485

I used D5 D6 D7 D8 D9 D10 D11 D12 for keypad.
I now want to add an ethernet module using SPI so need to move at least D12 D11 D10.

Can I use 4 of the keypad on D5 D6 D7 D8 and other 4 on A0 A1 A2 A3 without any problems by using
byte rowPins[ROWS] = {A3, A2, A1, A0};
byte colPins[COLS] = {8, 7, 6, 5};

Or is there more defines I need to make

The above connections should be alright as (by default) A0 - A3 pins are digital pins. These pins become analog pins when the ADC Module is activated by programming the ADEN-bit.

So why did you post in a section that said not for your projects.
Moved it here

Ahh ok. I didnt know this. All the pinouts etc just say A0 A1 A2 A3 A6 A7 are analogue

You can use any of the analog pins as digital except for A6 and A7, which are analog inputs only.

There is a library for connecting a keypad using an I2C port expander.

Again: For NANO --
A0 - A5 pins are digital pins by default (after power).
A6 - A7 pins are analog pins and are connected with the internal ADC. These two pins cannot be used as digital IO pins.

Yes Ive been looking at that as my next method and for future projects will probably try and utilise it for control but im just getting back into projects after a long break and just jumped straight into it without knowing where i wanted to take this project

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.