Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
puredata:gpio [2020/01/28 21:56]
admin
puredata:gpio [2020/03/06 19:27]
admin
Line 5: Line 5:
 {{:puredata:pd_wiringpi_mcp3008_gpio-help_jan2020.png?|}} {{:puredata:pd_wiringpi_mcp3008_gpio-help_jan2020.png?|}}
  
-Wiring for the Raspberry Pi was written by Gordon Henderson.\\ +[[https://puredata.info/|Pure Data]] (Pd) is a visual programming language developed by Miller Puckette.\\ 
-WiringPi for Pure Data was written by Miller Puckettte, Jaime Oliver La Rosa and Jeremiah Rose.\\+ 
 +[[http://wiringpi.com/|Wiring]] for the Raspberry Pi was written by Gordon Henderson.\\ 
 +WiringPi for Pure Data was written by Miller Puckette, Jaime Oliver La Rosa and Jeremiah Rose.\\
 This is a workaround for installing the WiringPi object and using the analog digital converter [[http://ww1.microchip.com/downloads/en/DeviceDoc/21295d.pdf|MCP3008]] for analog inputs in Pure Data on a Raspberry Pi 4 with This is a workaround for installing the WiringPi object and using the analog digital converter [[http://ww1.microchip.com/downloads/en/DeviceDoc/21295d.pdf|MCP3008]] for analog inputs in Pure Data on a Raspberry Pi 4 with
 [[https://www.raspberrypi.org/downloads/raspbian/|Raspbian Buster]].\\ [[https://www.raspberrypi.org/downloads/raspbian/|Raspbian Buster]].\\
Line 26: Line 28:
    $ cd /tmp    $ cd /tmp
    $ wget https://project-downloads.drogon.net/wiringpi-latest.deb    $ wget https://project-downloads.drogon.net/wiringpi-latest.deb
-   $ sudo dpkg -i wiringpi-latest.+   $ sudo dpkg -i wiringpi-latest.deb
 [[http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/]]\\ [[http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/]]\\
  
 === Install the WiringPi for PD === === Install the WiringPi for PD ===
 +
 Download: {{ :puredata:pd-wiringpi.zip |}}\\ Download: {{ :puredata:pd-wiringpi.zip |}}\\
 +   $ wget www.dernulleffekt.de/programme/pd-wiringpi.zip
 +   $ unzip pd-wiringpi.zip
 +   $ cd pd-wiringpi/
 +   $ cp -R wiringPi_gpio/ /home/pi/Pd/externals/
 +   $ cp -R wiringPi_mcp3008/ /home/pi/Pd/externals/
 +
 Unzip and copy the wiringPi_gpio and the wiringPi_mcp3008 folder in the PD external folder.\\ Unzip and copy the wiringPi_gpio and the wiringPi_mcp3008 folder in the PD external folder.\\
-/home/pi/Documents/PD/externals\\ +   /home/pi/Pd/externals 
-In Pure Data -> Preferences -> Path set the path to these two folders.\\ +One has to run Wiring PD with administration rights: 
-{{:puredata:pd_wiringpi_path_jan2020.png?375|}}\\+   $ sudo pd 
 +In Pure Data -> Preferences -> Path set the path to the two external folders. You might have to set the path for the PD folder, too. It should look like that.\\ 
  
 +{{:puredata:pd_wiringpi_path_jan2020.png?|}}\\
 +
 +=== Or install pdwiringPi ====
 +
 +An other wiringPi external is that one [[https://github.com/garthz/pdwiringPi]] by Garth Zeglin. It also support PWM over GPIO for the pins: 12, 13, 18, 19.\\
 +   $ wget https://github.com/garthz/pdwiringPi/archive/master.zip
 +   $ unzip master.zip
 +   $ cd pdwiringPi-master
 +   $ make
 +There should be a new folder called "pdwiringPi". Add that one the Pure Data -> Preferences -> Path.\\   
 +
 +----
 === Pin Configuration === === Pin Configuration ===
-The Wiring library has its own [[http://wiringpi.com/pins/|pin labeling]]: +The Wiring library has its own [[http://wiringpi.com/pins/|pin labeling]]:\\ 
-[[http://wiringpi.com/wp-content/uploads/2013/03/pins.pdf]]\\+[[http://wiringpi.com/wp-content/uploads/2013/03/pins.pdf|Wiring Pins.pdf]]\\ 
 +On Sparkfun one found a good pin labeling, too:\\ 
 +[[https://learn.sparkfun.com/tutorials/raspberry-gpio/all]]\\
 \\ \\
 **For example:\\ **For example:\\
Line 48: Line 72:
 The GPIO access needs administration rights, so one has to start Pure Data with these rights from the terminal: The GPIO access needs administration rights, so one has to start Pure Data with these rights from the terminal:
    $ sudo pd    $ sudo pd
-{{:puredata:pd_wiringpi_gpio-help_jan2020.png?793|}}\\+ 
 +{{:puredata:pd_wiringpi_gpio-help_jan2020.png?|}}\\ 
 Open the wiringPi_gpio-help.pd file and have fun with the GPIOs!\\ Open the wiringPi_gpio-help.pd file and have fun with the GPIOs!\\
  
 === WiringPi and the MCP 3008 === === WiringPi and the MCP 3008 ===
 +
 +{{:puredata:raspberrypi_mcp3008.jpg?600|}}\\
  
 For the hardware wiring of the 10 bit analog to digital converter MCP 3008  connect the pins of the MCP3008 like that:\\ For the hardware wiring of the 10 bit analog to digital converter MCP 3008  connect the pins of the MCP3008 like that:\\
-{{:puredata:sensors_raspberry_pi_mcp3008pin.gif?200|}}+{{:puredata:sensors_raspberry_pi_mcp3008pin.gif?200|}}\\
  
    MCP3008       Raspberry Pi    MCP3008       Raspberry Pi
Line 74: Line 102:
 Open PD as administrator (sudo pd) and then open the wiring_mcp3008-help.pd file. After clicking on setup_wiringPi the analog inputs should work.\\ Open PD as administrator (sudo pd) and then open the wiring_mcp3008-help.pd file. After clicking on setup_wiringPi the analog inputs should work.\\
  
-{{:puredata:pd_wiringpi_mcp3008-help_jan2020.png?764|}}\\+{{:puredata:pd_wiringpi_mcp3008-help_jan2020.png?|}}\\ 
  
 ---- ----
 ==== Links ==== ==== Links ====
  
 +PD:\\
 [[https://puredata.info/]]\\ [[https://puredata.info/]]\\
 +
 +Wiring:\\
 [[http://wiringpi.com/]]\\ [[http://wiringpi.com/]]\\
 +[[https://github.com/WiringPi/WiringPi]]\\
 [[https://github.com/jeremiahrose/pd-wiringpi]]\\ [[https://github.com/jeremiahrose/pd-wiringpi]]\\
 [[http://pi.bek.no/pd_wiringPi_GPIO/]]\\ [[http://pi.bek.no/pd_wiringPi_GPIO/]]\\
 +
 +MCP3008:\\
 [[https://learn.adafruit.com/raspberry-pi-analog-to-digital-converters/mcp3008]]\\ [[https://learn.adafruit.com/raspberry-pi-analog-to-digital-converters/mcp3008]]\\
 +
 +GPIO:\\
 [[https://www.raspberrypi.org/documentation/usage/gpio/]]\\ [[https://www.raspberrypi.org/documentation/usage/gpio/]]\\