BBB GPIO access with java

98 views
Skip to first unread message

hoerting...@gmx.at

unread,
Apr 21, 2016, 4:36:10 PM4/21/16
to BeagleBoard
Hello!

Did someone know a good free LIB for accessing the GPIO from the Beaglebone Black?
I know:

But not sure if I make mistakes ... very often I cannot inititalize:
private final Board board = Platform.createBoard();

This happens, when I destroy my class. I do before this:
board.shutdown();

And add a new instance of my class.
Then it often happen that the command give an error.

So is there another lib for control GPIO in Java?

Thank you!

William Hermans

unread,
Apr 21, 2016, 6:27:43 PM4/21/16
to beagl...@googlegroups.com
 Any file system linrary would work, with the knowledge of how sysfs works.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/9f6d0da8-3a08-4467-b950-2af84e666374%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William Hermans

unread,
Apr 21, 2016, 6:28:19 PM4/21/16
to beagl...@googlegroups.com
Any file system *LIBRARY* . . . . typo.

arsi

unread,
Apr 22, 2016, 4:08:34 AM4/22/16
to beagl...@googlegroups.com
Hi,

Read:
                boolean value;
                char data[] = new char[1];
                FileReader ff = new FileReader(path);
                ff.read(data);
                value = !(data[0] == '0');
                ff.close();
Write:
		
        boolean value = true;
        FileWriter writer = new FileWriter(path);
        if (value) {
            writer.write("1");
        } else {
            writer.write("0");
        }
        writer.close();

*********************************************

String path = "/sys/class/gpio/gpio48/value";
Arsi


Reply all
Reply to author
Forward
0 new messages