Downloading, installing, and running wiringPi

My motivation for using wiringPi is that I want to use it with Ruby. I had looked at a couple of alternative Ruby gems however 1 didn't work and the other depended upon wiringPi.

The download, installing, and running of wiringPi shouldn't take you 5 minutes if you have an LED and resistor already hooked up to the Raspberry Pi.


sudo apt-get install git-core

If you get any errors here, make sure your Pi is up to date with the latest versions of Raspbian:

sudo apt-get update
sudo apt-get upgrade

To obtain WiringPi using GIT:

git clone git://

If you have already used the clone operation for the first time, then

cd wiringPi
git pull origin

Wil l fetch an updated version then you can re-run the build script below.


cd wiringPi


Type the commands:

gpio mode 0 out
gpio write 0 1
gpio write 0 0

Alth ough I prefer to use the actual GPIO pins numbers

gpio -g mode  4 out
gpio -g write 4 1
gpio -g write 4 0


28-01-2013 20:50