Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

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!

share|improve this question

2 Answers 2

up vote 4 down vote accepted

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

share|improve this answer
    
This is interesting. Nice find Dexter. –  Jivings Sep 2 '12 at 11:52
    
Thanks;) I hope it helps :D –  Dexter Sep 2 '12 at 13:45
    
I agree, this will help me a lot, thanks Dexter! –  John Sep 2 '12 at 22:35

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: http://pi4j.com

rgds

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.