I can't seem to get the right pin number.
Let's say I want to access this pin:
What's the actual address of the pin? 11, 26 or what?
Here's the code I use: (THIS CODE WORKS WITH PIN BCM 23)
final Context context = Pi4J.newAutoContext();
final DigitalOutputConfig config = DigitalOutput.newConfigBuilder(context)
.id("motor")
.name("motor-output")
.address(23)
.shutdown(DigitalState.LOW)
.initial(DigitalState.LOW)
.provider("pigpio-digital-output")
.build();
final DigitalOutput output = context.dout().create(config);
output.high();
synchronized (Thread.currentThread()) {
try {
Thread.currentThread().wait(1000);
} catch (InterruptedException e) {
} finally {
output.low();
}
}
I have the Raspberry Pi 3B+
EDIT: Just for the context, I've already tried both pin addresses with no success.
EDIT 2:
Thanks to the response by @Milliways and the link provided by the answer from @joan, I was able to identify the correct pin address, it's 7 because of the BCM pin numbering scheme. The code works when connecting an LED, but won't work with a motor. I think it's because of the voltage or something, definitly not a problem in Pi4J.
I changed the pin from BCM 7 to BCM 23, that's why the code says .address(23). BCM 7 wouldn't change it's state.
