Hi,
I use pi4j for our JAVA program. We coded JAVA program with eclipse. We added pi4j library both eclipse and raspberry. I didn't remember how. However, I watched
https://www.youtube.com/watch?v=D-cTUEKbJJA video and this video is very helpful. Also, we tried pi4j examples.
Also, pi4j pinout and raspberry pinout are different. Please check your pin. For example, physical 11th pin's name is GPIO_17 in raspberry but if you use pi4j library, you should use GPIO_00.
Raspberry pi 2 pinout :
https://www.element14.com/community/ser ... IO_Pi2.png
Pi4j pinout :
http://pi4j.com/pins/model-2b-rev1.html
If you look this example
http://pi4j.com/example/listener.html ;
GPIO_02 is pi4j pinout and physical 13th pin.
Code: Select all
final GpioPinDigitalInput myButton = gpio.provisionDigitalInputPin(RaspiPin.GPIO_02, PinPullResistance.PULL_DOWN);