New utility ofxGPIO


Hi guys,

I received some reports for ofxGPIO with debian stretch,
last week I solved the most important problem related to the compilation.

in these last days I decided to add some features.

if you work without openframeworks for simple projects you can find it useful:

Gtk+ UI bridge to build simple graphical interfaces
TCP Unix socket for communication between application or more raspberry

I added a GPIOS class with an example only for openframeworks users
to control I/O of almost all variants GPIO (orangepi/raspberrypi) from a graphical interface.

(this example work only openframeworsk)


and added:

simplified syntax for class GPIO and MCP

read these examples:


(TCP server, control pin: GPIO17)


(TCP client, ON/OFF button example for control: example-server-led )


(Gtk+ UI sample)


check readme and documentation.

sample image:

(Gtk+ UI widget)

(Gtk+ client TCP -> server TCP)

(OF UI control I/O GPIO)

Happy holidays to all!


hello @kashim , I downloaded the ofxGPIO zip file today 24th Nov 2018, to run with openFrameworks and was trying to use your example-simple-button , modified for my code in the .h and .cpp files, but on trying to compile(using β€˜make’ in the terminal) I am getting this error, pasted below:

In file included from /home/pi/openFrameworks/addons/ofxGPIO/src/ofxGPIO.h:40:0,
                 from /home/pi/openFrameworks/apps/myApps/myRpiApp/src/ofApp.h:5,
                 from /home/pi/openFrameworks/apps/myApps/myRpiApp/src/main.cpp:2:
/home/pi/openFrameworks/addons/ofxGPIO/src/gpio.h:28:7: error: expected identifier before β€˜=’ token
  OUT  = 0,
/home/pi/openFrameworks/addons/ofxGPIO/src/gpio.h:28:7: error: expected β€˜}’ before β€˜=’ token
/home/pi/openFrameworks/addons/ofxGPIO/src/gpio.h:28:7: error: expected unqualified-id before β€˜=’ token
/home/pi/openFrameworks/addons/ofxGPIO/src/gpio.h:30:1: error: expected declaration before β€˜}’ token
/home/pi/openFrameworks/libs/openFrameworksCompiled/project/makefileCommon/ recipe for target 'obj/linuxarmv6l/Release/src/main.o' failed
make[1]: *** [obj/linuxarmv6l/Release/src/main.o] Error 1
make[1]: Leaving directory '/home/pi/openFrameworks/apps/myApps/myRpiApp'
/home/pi/openFrameworks/libs/openFrameworksCompiled/project/makefileCommon/ recipe for target 'Release' failed
make: *** [Release] Error 2

At my end, I am able to compile the example-gpio-pindescription from the examples folder on the raspberry, without any trouble. I am using a Pi3 ModelB with the latest Raspbian OS downloaded from the raspberry pi website.

My objective is to make a physical interface to only play a video when the button is released and take the video back to starting point, on pressing of the button. Besides using ofxGPIO I’m also using ofOMXPlayer as the other addon.

Please let me know, how I can resolve this?


hey @kayDee, I stumbled on your question while trying to solve the same issue.

It seems to be a naming conflict with the OUT enumerator on line 28 of gpio.h and some other dependency. Change β€œOUT” to anything else and update all the references to it and it’ll work.