Primeiramente gostaria de salientar que não sou o autor principal do conteúdo deste artigo. A minha intenção é de mostrar o que outros autores tem realizado (referenciando links para o conteúdo original) neste blog até como um guia pessoal para uso próprio e ainda compartilhar minhas anotações e pequenas modificações que realizo no conteúdo, desejando que possa ajudar mais alguém em algum lugar.
WiringPi defines 17 pins, (21 on a Rev. 2 board) but some of them and the functions we can use may potentially cause problems with other parts of the Raspberry Pi Linux system.
Remember: The Raspberry Pi is a 3.3 volt device! Attempting to directly connect to any 5V logic system will very likely result in tears…
The following tables give the mapping of the Raspberry Pi GPIO Pins to the GPIO connector in relation to the pin numbers and the physical location on the connector. This is a representation of the GPIO connector as viewed looking at the board from above, with the USB power at the top and the GPIO to the top-right of the board.
If using the connector pin numbering, then note that Pin 1 on the connector is the 3.3v supply. Pin 2 is the 5V supply, and pin 26 is marked SPI CE1 below.
P1: The Main GPIO connector:
P5: The auxilliary GPIO connector present on Rev. 2 boards only:
Note also that the P5 connector is designed to be used from the underside of the Pi – ie. you solder on the top of the Pi board to install the connector! If you are using it from the top, then you need to mirror the diagram above.
Each side has three columns. The outermost column, headed wiringPi Pin refers to the pin number in the wiring Pi code. The middle one, headed BCM GPIO refers to the pin number of the BCM2835 chip, an this is the pin number used when addressing the GPIO using the /sys/class/gpio interface. The innermost column, Name is the name of the function of the pin.
The central column contains the pin numbers on the header on the board. Pin 1 is the 3.3v power supply on the P1 connector (Rev. 1 and Rev. 2 boards), and Pin 1 is the 5v power supply on the P5 connector on Rev. 2 boards only.