NAME PIN PIN NAME
3.3 V

1

 ● 2 5 V
GPIO 0 / 2 I2C SDA 3  ●  ● 4 5 V
GPIO 1 / 3 I2C SCL 5  ●  ● 6 GND
GPIO 4 7  ●  ● 8 GPIO 14 UART TXD
GND 9  ●  ● 10 GPIO 15 UART RXD
GPIO 17 11  ●  ● 12 GPIO 18
GPIO 21 / 27 13  ●  ● 14 GND
GPIO 22 15  ●  ● 16 GPIO 23
3.3 V 17  ●  ● 18 GPIO 24
GPIO 10 SPI MOSI 19  ●  ● 20 GND
GPIO 9 SPI MISO 21  ●  ● 22 GPIO 25
GPIO 11 SPI SCLK 23  ●  ● 24 GPIO 8 SPI CE0
GND 25  ●  ● 26 GPIO 7 SPI CE1

Python can talk to the GPIO ports in 2 ways.

1. Pin number – BOARD mode

import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)#set to board mode
GPIO.setup(10, GPIO.OUT) #Using pin number 10
GPIO.output(10, GPIO.LOW)

2. Pin name – BCM mode

 

import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(15, GPIO.OUT) # Using pin name GPIO 15
GPIO.output(15, GPIO.LOW)

 

Both of the above scripts talk to exactly the same pin!