#includeĪfter that, initialize the GPIO using wiringPiSetup() To use the wiringPi library, there must be an include line in the beginning of the sketch.
#RASPBERRY PI BEST IDE FOR C INSTALL#
However, if by chance you’re using an older version of the Pi, you can enter this command to install it: git clone git:///wiringPi WiringPi is included in the standard Raspberry Pi OS package so no need to install it. The pinout command also shows you a labeled graphic of the Pi and some details on its hardware components. Figure 1: Raspberry Pi GPIO PinoutĪlternatively, you can view the pinout directly in the terminal using the command, pinout. In Figure 1 you will see the BCM names on the labels while the numbers inside the circles are P1. One is the Broadcom chip-specific pin numbers layout (BCM) and another is the P1 physical pin numbers layout. It was initially 26 pins but was upgraded to 40 while retaining the original pinout.įurthermore, there are two numbering schemes that reference to the pin numbers. The Raspberry Pi uses a standard male header layout for its GPIO. These pins are very handy for a portable computer like Pi because, with it, you can already read sensor data, spin motors, drive LCD displays, and etc. The Raspberry Pi includes 2 columns of GPIO pins along the edge of the board. Moreover, they have no dedicated function and are only used when its user needs to work with auxiliary electronic components outside of its system. A bi-directional pin can either output 3.3V when programmed HIGH or 0V when programmed LOW, or act as an input for sensors. GPIO, also known as General-Purpose Input/Ouput, is a bi-directional digital signal pin commonly found in microcontrollers and electronic circuit boards.