Arduino Nano - Are all Digital pins the same?

Arduino Nano - Are all Digital pins the same?

  • If I come up with a tutorial that suggests D10, D11, D12 and D4 can I substitute D4 for D13?
  • What is special about D4?
  • My present project is using D4 and I would like to add a CD card module.

Maybe, maybe not. We have no idea what you are doing.

From what I can see D4 has no specific function, but D13 is the SPI clock. So if you are using SPI then you can't swap them.

So, what are you doing?

No not all the Pins are the same. Some of them got special options like PWM, but you can still use them as a normal digital pin.

What you usually do is, you use "basic" pins for basic work and try to keep the special ones free. If you want to add something later, that needs a special pin it will be free.

Look up the Nano documentation to see all pins and their properties.

Best regards MajorProb

http://pighixxx.com/nanopdf.pdf

Depends on what feature of the pin you need.

Any pin can be used for chip select for an SD card, except for d11-12-13, which are required to be used as MOSI-MISO-SCK to the SD card already (by SDfat.h, or SD.h). D10 must be an output when the arduino is SPI master (needed for SD card access). Try and leave D0, D1, free for serial comms. Thus you can set up the code to use any of D2-10, and D14-D19 as the chip select pin.

OK ..... Thanks for the replies.

My Arduino Nano project so far is a GPS module outputting to a 16x2 LCD display. The SD Card module just arrived and I would like to connect it to my project for data logging.

I would like to use D10, D11, D12 and D13 for the SD card due to the LCD occupying D4, D10 and D11 among other pins, but all the SD card tutorials show pins D10, D11, D12 and D4 being used.

I can't get the LCD to work when I move D4 to another pin. My guess is that both the LCD and SD card module require pin D4.

INTP: http://pighixxx.com/nanopdf.pdf

Depends on what feature of the pin you need.

Thank you ...... the Nano PDF helps a lot.