Interfacing
Using pi4j to control GPIO
37
21113
View: 21113|Reply: 37
|
[Interfacing]
Using pi4j to control GPIO
[Copy link]
|
|
Hello, It's possible to use the java library pi4j ( http://pi4j.com/ ) on banana to control GPIO?
I used it on raspberry pi and it works fine but on banana (running the same example ) nothing work.
I simply want to blink a led (GPIO_01): i've to connenct tried all possible pins but the led is ever turned off.
Someone can help me? |
|
|
|
|
|
|
|
Now Lemaker has ported RPi.GPIO and WiringPi into the Banana Pi. The two can work well. But we didn't test the pi4j, we don't know much about it. But if many users want to use, we will plan to make it work. |
|
|
|
|
|
|
|
Yes, I want it.
Java on Banana Pi is very cool! |
|
|
|
|
|
|
|
Hello tony_zhang,
I would also be very interested in using Pi4J with the BananaPi.
Thanks
Ghoddan |
|
|
|
|
|
|
|
I'd like to use Pi4J with the bananaPi.
Thanks
Rafa |
|
|
|
|
|
|
|
Hello, i have tryed the example that is included in PI4J examples:
http://unpocodejava.wordpress.co ... pberry-pi-con-java/
and I have notice that the first time, when you turn on the bananapi, and begins to run the program, the light turns on, but it doesn't do any more.
thanks, Rafa |
|
|
|
|
|
|
|
Hello All
I was looking at the code and saw that PI4J internally uses WiringPI if the WiringPI is already ported, I think the PI4J will work.
Luiz Lago |
|
|
|
|
|
|
|
Edited by cgen at 2014-10-16 13:55
Hello!
When I'm using version 0.0.5, an error occurs: wiringPiSetup: mmap failed: No such file or directory .
If I'm using version 1.0-SNAPSHOT, it is possible only to set a HIGH level on the pin.- GpioController gpio = GpioFactory.getInstance();
- GpioPinDigitalOutput pin = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_19, "MyLED", PinState.LOW);
Copy the Code for checking result.
The commandsandworking fine.
|
|
|
|
|
|
|
|
Hi, guys! I figured out the problem. It's simple .
The jar pi4j-core.jar has the native library libpi4j.so .
The library libpi4j.so statically linking with libwiringPi.a .
So you should to build it for your system. Then place it in the file pi4j-core.jar.
This is for version 0.0.5 from https://github.com/Pi4J/pi4j.git
Sources for version 1.0-SNAPSHOT, I could not find.
P.S.
I attached the JAR and library, but I have Ubuntu, so it may not work for you. |
|
|
|
|
|
|
|
cgen replied at 2014-10-24 17:53 
Hi, guys! I figured out the problem. It's simple .
The jar pi4j-core.jar has the native library ...
Good ! Thanks for sharing! |
|
|
|
|
|
|