Installing WiringPi (and pin allocation) – Raspberry Pi

WiringPi is a library that is used by many applications on the Raspberry but is not available by default. Especially many examples from the Arduino (C ++ code) can be performed easily on the RaspberryPi. To do so, this valuable library was written.



Your PI should be up-to-date, therefore:
sudo apt-get update && sudo apt-get upgrade

Now we need git:

sudo apt-get install git git-core

Now we need git: Now WiringPi can be downloaded and installed:

git clone git://
cd wiringPi
That’s it. To later upgrade to a newer version you can type the following command in that folder:
git pull origin

and the latest version is installed.


Pin allocation

The pin assignment of wiringPi is not the same as that of the GPIOs.

To get information about your Raspberry Pi you can enter this command:

gpio -v

The easiest way to output the pin allocation is typing

gpio readall

because it is different on the various models.


Here the pin assignment for Rev. 1 and Rev. 2:


One Response

  1. Every time I enter “git clone git://” into the Pi, it just error codes. I’m on a Pi 3 model B if that factors into the access somehow. Any idea why that may be happening?


Leave a Comment

Your email address will not be published.

Subscribe to Raspberry Pi Tutorials and don't miss any new Tutorial!