java-gpio - Java wrappers, code and programs for GPIO access (with interrupts and expled) - in GitHub
-
I have previously provided Java code for access to GPIO (see: https://community.onion.io/topic/458/java-wrapper-and-code-for-gpio-access-with-interrupts).
I have now released the latest version of the code on GitHub at https://github.com/KitBishop/java-gpio (note however that this currently lacking documentation which will be provided later).
Note that https://github.com/KitBishop/java-gpio makes use of new-gpio code from https://github.com/KitBishop/new-gpioTo be able to use the code, you must first meet the following pre-requisites:
- Your Omega must be on release 0.0.6-b265 or later
- Must have the kmod-gpio-irq package installed by running:
opkg update
opkg install kmod-gpio-irq - Must have sufficient disk space to install jamvm (a lightweight implementation of a full Java Virtual Machine) as in next point. Because jamvm needs more disk space to install than the Omega standardly has, you must extend the disk space using a USB drive as described in: https://wiki.onion.io/Tutorials/Using-USB-Storage-as-Rootfs
- Must have the jamvm package installed. This is a lightweight implementation of a full Java Virtual Machine
This may be installed by running:
opkg install jamvm - Optionally, it is useful (but not absolutely necessary) to extend the Omega's working memory with swap space as described in: https://community.onion.io/topic/533/using-linux-swap-space-on-the-omega
In the lack of detailed documentation (to come later), the simplest way to try out the code is using the following with the indicated files in GitHub:
-
java-gpio - a direct Java equivalent to the Omega supplied fast-gpio program and the new-gpio program from https://github.com/KitBishop/new-gpio
From https://github.com/KitBishop/java-gpio/tree/master/bin/java-gpio/withlib copy the file java-gpio.jar to your Omega.
This can be run on your Omega using the command:
jamvm -jar java-gpio.jar <parameters>
Where <parameters> are exactly the same as has been described for new-gpio -
java-expled - a direct Java equivalent to the Omega supplied expled script and the new-expled program from https://github.com/KitBishop/new-gpio
From https://github.com/KitBishop/java-gpio/tree/master/bin/java-expled/withlib copy the file java-expled.jar to your Omega.
This can be run on your Omega using the command:
jamvm -jar java-expled.jar <parameters>
Where <parameters> are exactly the same as has been described for new-expled
-
Awesome news Kit. Was not expecting that and it is great we have yet another platform to develop with.
Keep up the great work!
-
FYI: Documentation for this has now been added in the file java-gpio.pdf in the GitHub repository https://github.com/KitBishop/java-gpio
-
FYI: Code on https://github.com/KitBishop/java-gpio has now been updated to version 1.0.1
Changes are:- Fixed code bug in expansion led access
- Corrected documentation for running java-gpio.jar and java-expled.jar