Hi I am trying to do my own Android app (with Android Studio) that call to GPIOs, now I am able to use GPIO as output but I also need to set some GPIO as input.
In the Android 6.0.1 (any version) don’t exists the GPIO folder, so gpios can’t be exported. The only folder that exists is gpio_sw, with it I am able to set gpio data on/off, but I don’t know how to set a gpio as an input. By default all gpio are outputs.
- Together with “data” (file used to set a gpio to 1/0), I noticed that exist more files inside sys/class/gpio_sw/"gpio_name/ :
- And exists another folder inside each gpio, this folder is “…/gpio/power”. The files inside power folder:
- Inside this files, there only appears a binary/boolean value that we write with “echo” command (like a variable identifier).
=> Ok, what is the purpose for all this files? I.E: Pull file is for setting a pull-up or a pull down? “echo > 1 /sys/class/gpio_sw/PB7/pull”
***Can be this files used to set the GPIO port direcction? Any tutorial or info to use them?
=> In anoher hand I noticed that exist a sys_config.fex file that should be modified to get the UART working, and inside this file the GPIO can be defined as an input too. I am in the right way??? How can I modify sys_config.fex???.. I can’t find any info
=> Finally, I have read that exist a JAVA library called Pi4J with support for all BPI products including M64. I tried to use in Android Studio,the library and the imports looks recognized properly but I can’t build. How use Pi4J in Studio???
Thanks in advance