Hey all,
I have an Android development board and I run my Unity app on it. I want to use a custom controller that will be connected to the GPIO pins on the board.
How do I access the GPIO inputs from Unity?
Thank you
Hey all,
I have an Android development board and I run my Unity app on it. I want to use a custom controller that will be connected to the GPIO pins on the board.
How do I access the GPIO inputs from Unity?
Thank you
Unity doesn’t expose GPIO API in C#, thus you’ll need to manually call into java by using Unity - Scripting API: AndroidJavaClass, Unity - Scripting API: AndroidJavaObject
I feared as much
I built a module and make a connection through Unity but I still can’t find a way to access GPIO from the Android module. This is not a raspberry pi board, and the documentation is very limited.
Is there a general way or a library the helps access GPIOs?
You’ll have to search the internet for it, I guess try this - https://github.com/digi-embedded/android-sample-gpio and inspect the java files, you can then cherry pick the required code in to a new custom class, move it to Unity project and call the java functions from your new custom class from C#.