Choosing a pin on the Arduino

I am not sure this is the right place but I could not find a better one.

I have been reading the board info (Arduino - Board) but my question isnt answered.

In a lot of programs I see that the developer chooses pins like 3, 8, 11 or 2, 6, 11, 12 but almost never just 2,3,4,5.

PWM does not seem to be the reason.

So, why not choosing 2,3,4,5 etc? Why jump from 2 to 8 or something?

Some pins have special functions (SPI, serial, etc)

Thwy may be using specific pins for that reason, or they may just be using the pins they are using because it's convenient

The reason they pick those pins is they are connectable to the output of the PWM register internal to the microprocessor. These connections are not consistent between different micros you have to check. You can pick other pins if you like but you will have to do the PWM via software and lose all the advantages of the internal hardware PWMs.
Good Luck & Have Fun!
Gil

You mean the pins with ~?

Like I said, it looks like their choices have nothing to do with that.

Are 2-7 and 8-13 controlled by another part of the chip? is that it?

Sareno:
Are 2-7 and 8-13 controlled by another part of the chip? is that it?

Well, they are different ports. There are occasions where you may wish to read or write several pins simultaneously. Direct access through the ports lets you do that. Look for stuff like PIND in the examples you’re looking at.

It may just be arbitrary, or perhaps it makes it easier to verify that you’ve put the right wire in the right hole - if all your wires are the same colour, it can be harder to focus on which one goes where.

Keeping wires apart because you were having crosstalk issues is another possible reason.