I'm new to Raspberry Pi and I have just figured out how to use Java to power LEDs. However, I cannot get GPIO 23 to work. This is my wiring setup.
Here is the java code I am using to power the LEDs.
import java.io.IOException;
import javax.microedition.midlet.MIDlet;
import jdk.dio.DeviceManager;
import jdk.dio.gpio.GPIOPin;
public class LEDBlink extends MIDlet {
public static final int GREENLED = 23;
public static final int REDLED = 24;
public static final int YELLOWLED = 18;
@Override
public void startApp() {
try {
GPIOPin red = DeviceManager.open(REDLED);
GPIOPin green = DeviceManager.open(GREENLED);
GPIOPin yellow = DeviceManager.open(YELLOWLED);
red.setValue(true);
green.setValue(true);
yellow.setValue(true);
} catch (IOException ex) {
}
}
}
This code worked for GPIO 18 and 24 but not for 23.
I double checked my wiring, replaced all wiring including LED and resistor. I also used the command line to try running the LED. None of that worked.
Does anyone know why I am having trouble?