9

I just got Java running on my Raspberry Pi which took a lot more screwing around than i had hoped. I want to be able to read/write data to/from the header pins from Java. How can I do this? Do I need to write a driver or some sort with C first in order to get the data from the header pins? I am running an instance of Soft-float Debian "wheezy." Is this even possible to do in Java? Are there any workarounds that I should know about? Thanks for reading!

John La Rooy
12k9 gold badges49 silver badges77 bronze badges
asked Sep 2, 2012 at 5:52

2 Answers 2

5

That should be possible in Java, as referenced here. The library which is used is called rpi-gpio-java and is available at this URL. As stated in the notes, to make it work, please make sure your application is run as root.

Note: Above project rpi-gpio-java is no longer available on google code. Alternate option is PI4J

Steve Robillard
35k18 gold badges106 silver badges110 bronze badges
answered Sep 2, 2012 at 8:07
1
  • This is interesting. Nice find Dexter. Commented Sep 2, 2012 at 11:52
3

If you did not already foud your solution, the Pi4J Library, based on Wiring for the Raspberry Pi, offers - also on an early development stage - acces to GPIO, I2C and SPI. And Rs232, not to forget!

Serviceprovider for several IO-boards (Olimex etc.) are included.

Most interesting: Event driven processing (GPIO-Interrupts).

see: here

Ghanima
16k17 gold badges66 silver badges127 bronze badges
answered Nov 5, 2012 at 11:29

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.