Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

When I had Raspberry Pi I used to control the GPIO (pins) from a Java application using the Pi4J library.

Is there any library to control the GPIO (pins) on the PcDuino using the Java language?

share|improve this question

1 Answer

up vote 0 down vote accepted

I haven't used that platform myself but the Java GPIO Manager appears to be what you're after. Looking at the source code it appears straightforward and is using file access to control the files created by the device driver for each pin under the following path:

/sys/devices/virtual/misc/gpio/mode/
/sys/devices/virtual/misc/gpio/pin/

There is a Accessing GPIO Pins tutorial at Sparkfun that shows for mode the following values may be used, although they are already declared in the above Java library as constants:

  • 0 = Input
  • 1 = Output
  • 8 = Input with internal pull-up

With the the pin values just being the obvious 0 for low and 1 for high. Note that those values are in ASCII so use "0" etc rather than a binary value.

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.