OF and Raspberry pi - Pin read/write?

Hi all,

Very excited at the prospect of porting audio/synth stuff to the Pi. What are the chances of reading/writing to pins within the OF app (pots, buttons, leds)? Is this something that can be achieved easily?

I’ll definitely be ordering a PI to play with next month!!!

Cheers
Alex

1 Like

We did some of this using wiringPi for the Resonate workshop. The example is called wiringPiPotentiometerExample and is part of this repo

https://github.com/andreasmuller/RaspberryPiWorkshop

You have to do some system tweaks to whitelist some kernel modules and run as “sudo” but all of that is listed in the README as well

I’ve updated the repo recently for OF .8 but haven’t tested the GPIO stuff yet but it was at least still compiling

Hi!
Thanks! I’ll check it out,
Can’t wait to get my fingers in the PI… :wink:

Hei everione.
I am trying to use GPIO pins with open frameworks.

I have installed wiringPi as is said in dragon.org

I tested the correct installation by runing gip ready. and i get the readings from the pins like specked.

I have edited the config.make file to make the linking like is in dragon.org.

But when i compile my project, the compiler can’t find wiringPi.h

Any idea about what is going on?

Thanks

@juliolucio - a bit delayed but you probably just need to add the include path

Here is where I did it

1 Like

Thanks a lot :smile:
delayed but very useful.

hi

have you guys tried this with OF 0.9.0 and PI2 ? or are there modifications that need to be done?

i just got a PI2, got OF 0.9.0 working and am now planning to talk to the GPIOs.

thanks,
stephan.

Did you manage to get working GPIOs in of 0.9 and PI2?
I am looking now to that.

Thanks,

Mar

yes i got it to work.

i followed this guide to get OF on to the PI2:
http://openframeworks.cc/setup/raspberrypi/Raspberry-Pi-Getting-Started.html

and followed this guide for the GPIO stuff on sparkfun (wiringPi):
https://learn.sparkfun.com/tutorials/raspberry-pi-2-starter-kit-hookup-guide?_ga=1.105652288.232595118.1417458993

here is my config.make file which has the paths to the right libraries and stuff:

i never used the make commands before. so, it took a while to work out how to compile the OF examples. Basically via the LXTerminal app in the Raspberry GUI environment (which is called x).
there use the cd to get to the right location, then use make.
in order to run OF apps that use GPIOs you need to use sudo make run.
you might know all this already.

stephan.

1 Like

Hi!
I have had good results using Python to deal with the GPIO on Pi2s. May taht be an option?