New utility ofxGPIO


#1

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)

example-gpio-pindescription

and added:

simplified syntax for class GPIO and MCP

read these examples:

example-mcp-simple-syntax
example-simple-syntax-gpio

(TCP server, control pin: GPIO17)

example-server-led

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

example-gtk2-client

(Gtk+ UI sample)

example-gtk2-led
example-gtk2-ui

check readme and documentation.
http://www.ziggurats.net/port.php?port=ofxGPIO

sample image:

(Gtk+ UI widget)

(Gtk+ client TCP -> server TCP)

(OF UI control I/O GPIO)

Happy holidays to all!


#2

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/compile.project.mk:221: 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/compile.project.mk:124: 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?