I am basically trying to turn on a led by using pi4j library. My code is pretty simple:
public static void main(String args[]) throws InterruptedException {
GpioController gpioController = GpioFactory.getInstance();
GpioPinDigitalOutput pinOut = gpioController.provisionDigitalOutputPin(RaspiPin.GPIO_17);
pinOut.high();
Thread.sleep(5000);
pinOut.low();
}
I am exporting the jar file from my computer, copying to my Raspberry Pi 4 than running in there.
To check if my led is not broken or GPIO is set, I've executed following Python scripts and I see my led works perfectly:
python
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
GPIO.output(17,True)
What am I missing?