Arduino R3 pins assignment

Hello,

I was assigning some Input and Output for Arduino R3 board, and I notice that pin 0 and 1 are different from the other pins.

Do these pins are also available for Input and Output?

Thank you in advance.
With best regards.
Jorge

Yes they are, but only if you are not using serial in your sketch. If you are using serial, then those pins are for communication with your computer or other boards via serial.

If you can stay away from 0 and 1. They default to special use.

No need to assign for INPUT. Pins default to INPUT.
Note that the analogue pins can also be used as normal digital I/O.
pinmode(A1, OUTPUT); // is valid
Best to not use pin 0,1 until you understand the restrictions.
Leo..

Well yes and no.

If you use them then they will interfere with the uploading of code. A common way round this limitation is to have a double throw switch, that you use to switch between a loading code mode, and a running mode. I often do this with MIDI circuits. I made a MIDI shield, that looked like this

Notice the program mode switch.

The schemata for this is

Note the dotted line between the two switches. This indicates that the two switches are ganged, that means they are a double throw switch. So during code upload they are switched to the TX & RX pins, and once they are uploaded you can use these pins like you would any other.

Well, thank you very much for your answers. As suggested, better not counting with these pins.
Best regards.

1 Like