Raspberry Pi pin mappings

You need to know which physical header pins on the Raspberry Pi correspond to which pin numbers you access in your code. For example the pin 37 (second from bottom left pin) maps on GPIO 26. There is a very helpful document on the Microsoft web site that gives you the pin mappings, but for convenience I’ve also summarised the information in the following table:

GPIO# Power-on Pull Alternate Functions Header Pin
2 PullUp I2C1 SDA 3
3 PullUp I2C1 SCL 5
4 PullUp 7
5 PullUp 29
6 PullUp 31
7 PullUp SPI0 CS1 26
8 PullUp SPI0 CS0 24
9 PullDown SPI0 MISO 21
10 PullDown SPI0 MOSI 19
11 PullDown SPI0 SCLK 23
12 PullDown 32
13 PullDown 33
16 PullDown SPI1 CS0 36
17 PullDown 11
18 PullDown 12
19 PullDown SPI1 MISO 35
20 PullDown SPI1 MOSI 38
21 PullDown SPI1 SCLK 40
22 PullDown 15
23 PullDown 16
24 PullDown 18
25 PullDown 22
26 PullDown 37
27 PullDown 13
35* PullUp Red Power LED
47* PullUp Green Activity LED

* = Raspberry Pi 2 ONLY. GPIO 35 & 47 are not available on Raspberry Pi 3.

Lascia un commento