alkex
September 16, 2013, 12:39pm
#1
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
alkex
September 17, 2013, 2:51pm
#3
Hi!
Thanks! I’ll check it out,
Can’t wait to get my fingers in the PI…
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
#
# (default) PROJECT_CFLAGS = (blank)
#
# Note: Before adding PROJECT_CFLAGS, note that the PLATFORM_CFLAGS defined in
# your platform specific configuration file will be applied by default and
# further flags here may not be needed.
#
# Note: Leave a leading space when adding list items with the += operator
################################################################################
WIRING_PI_INCLUDE_DIR = $(WIRINGPI_DIR)/include
PROJECT_CFLAGS = -I$(WIRING_PI_INCLUDE_DIR)
################################################################################
# PROJECT OPTIMIZATION CFLAGS
# These are lists of CFLAGS that are target-specific. While any flags could
# be conditionally added, they are usually limited to optimization flags.
# These flags are added BEFORE the PROJECT_CFLAGS.
#
# PROJECT_OPTIMIZATION_CFLAGS_RELEASE flags are only applied to RELEASE targets.
#
# (default) PROJECT_OPTIMIZATION_CFLAGS_RELEASE = (blank)
1 Like
Thanks a lot
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?