This is an old revision of the document!
Table of Contents
Wiring Pi for Pure Data
Controlling the GPIO pins and an analog digital converter (MCP3008) in Pure Data on a Raspberry Pi.
Wiring for the Raspberry Pi was written by Gordon Henderson.
WiringPi for Pure Data was written by Miller Puckettte, Jaime Oliver La Rosa and Jeremiah Rose.
This is a workaround for installing the WiringPi object and using the analog digital converter MCP3008 for analog inputs in Pure Data on a Raspberry Pi 4 with
Raspbian Buster.
Pure Data and Wiring Pi
Install Pure Data
In the terminal:
$ sudo apt update $ sudo apt install puredata
Install Wiring
In the terminal:
$ sudo apt-get install wiringpi
For the Raspberry Pi 4 one needs to update the WiringPi to version 2.52:
$ cd /tmp $ wget https://project-downloads.drogon.net/wiringpi-latest.deb $ sudo dpkg -i wiringpi-latest.
http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/
Install the WiringPi for PD
Download: pd-wiringpi.zip
Unzip and copy the wiringPi_gpio and the wiringPi_mcp3008 folder in the PD external folder.
/home/pi/Documents/PD/externals
In Pure Data → Preferences → Path set the path to these two folders.

Pin Configuration
The Wiring library has its own pin labeling:
http://wiringpi.com/wp-content/uploads/2013/03/pins.pdf
For example:
pin 0 is GPIO 17
pin 1 is GPIO 18
Run WiringPi
The GPIO access needs administration rights, so one has to start Pure Data with these rights from the terminal:
$ sudo pd

Open the wiringPi_gpio-help-pd file and have fun with the GPIOs!