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.

 

Install

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://git.drogon.net/wiringPi
cd wiringPi
./build
That’s it. To later upgrade to a newer version you can type the following command in that folder:
git pull origin
./build

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:

pinbelegung-wiringpi

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

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