Unable to open GPIO direction interface for pin #400
Unanswered
andi-riese
asked this question in
Q&A
Replies: 1 comment
-
Haven't used v1 code in a long time to suggest a full fix. Looking at your code it is not one of the V1 examples i could find. I think to simplify your debug look at the V1 web pages https://www.pi4j.com/1.4/usage.html and test the example line for line and see if successful. Also seeing wiringpi and that V1 use, unless you are editing in a large set of V1 code and migration is not practical, if the target machine is one of the raspberry Pi I would recommend using Pi4j_V2 for new work. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I try to run the following code:
package test;
import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioFactory;
import com.pi4j.io.gpio.GpioPinDigitalInput;
import com.pi4j.io.gpio.PinPullResistance;
import com.pi4j.io.gpio.RaspiPin;
import basic.L;
public class Test {
// L.t("", (Object[]) RaspiPinNumberingScheme.values());
// GpioFactory.setDefaultProvider(new RaspiGpioProvider(RaspiPinNumberingScheme.DEFAULT_PIN_NUMBERING));
GpioPinDigitalInput myButton = gpio.provisionDigitalInputPin(RaspiPin.GPIO_29, // PIN NUMBER
"MyButton", // PIN FRIENDLY NAME (optional)
PinPullResistance.PULL_DOWN);
L.t("Ende 1");
gpio.shutdown();
L.t("Ende 2");
}
}
Beta Was this translation helpful? Give feedback.
All reactions