Pin Configurations#

Each Arduino board have different pins for various functions, these differ between boards and the user must take care to correctly connect according to the board type. These are labelled, generally most sketches refer to the Uno board, so be careful when using another board.

Arduino_pins.csv#

Arduino Board

Pin Type

Numbers

Remarks

Uno

Digital Input

0 - 13

Uno

Digital Output

0 - 13

Uno

Analogue Inputs

A0 - A5

can operate as Digital I/0

Uno

Pulse Width Modulation (PWM)

3,5,6,9,10,11

Uno

Serial Peripheral Interface (SPI)

10 - 13

2560

Digital I/O

0 - 53

2560

Analogue Inputs

A0 - A15

can operate as Digital I/0

2560

PWM

2 - 13

2560

SPI

22 - 25

Most of the commands allow the program to operate synchronously, delay() prevents the Arduino from doing anything else. Interrupts allow asynchronous operation, so that fast events can be detected during a slower process. Only a few reserved pins can be used for this process.

Table Arduino Interrupt Pins#

Arduino_interrupt_numbers.csv#

Arduino Board

Interrupt

Numbers

Remarks

0

1

2

3

4

5

Uno

D2

D3

Leonardo

D3

D2

D0

D1

First two reverse to Uno

Mega2560

D2

D3

D21

D20

D19

D18

Due

Pin numbers as opposed to interrupt numbers