Use Raspberry pi GPIO as input

It’s possible to use the GPIO pins of a Raspberry pi as input events?
Or access them with a python script and then send the value from the script to armory3d and use them as inputs?

I don’t know much about the Raspberry Pi, but I imagine it would be easy to control using logic nodes if it could recognize GPIO input as a keyboard, mouse, or gamepad.

1 Like

Thanks for the reply!
another question: with armory can I use a haxe script normally or a haxe scripts can only perform functions limited to the graphics engine?
because I found this library that could be useful: https://lib.haxe.org/p/hxPiGpio

You can use external Libraries in Armory as long as they export well to the Platform you want Armory exporting to. To do this you create a “Libraries” folder next to your .blend and put the folder with the Library you want to use in there. Next in Blender, you create a text file in the text editor and give it a name. It’s content needs to be project.addLibrary("YOURLIBRARYNAME"). Save it and go to Properties -> Render Properties -> Armory Project -> Modules -> Khafile and select your textfile. Now you should be able to use the Library in your project.

2 Likes