Hi my first Java program to control a LED has failed, the LED does not come on even though the pin state is continuously HIGH ?
Heres the Java code :-
final GpioController gpio = GpioFactory.getInstance();
System.out.println("Setting GPIO_04 as output");
final GpioPinDigitalOutput led = gpio.provisionDigitalOutputPin( RaspiPin.GPIO_04 );
boolean currentState = false;
for (;;) {
Thread.sleep( 1000 );
System.out.println("Current state is " + led.getState());
led.toggle();
}
This prints out :-
Setting the GPIO_04 as output
Current state is HIGH
Current state is HIGH
Current state is HIGH
etc... ?? What am I doing wrong ? why is the state continuously HIGH and why isnt the LED on ? (It comes on if I connect to the 5v or 3.3v pins so the circuit is ok)