Skip to content

IOReadException: I/O READ ERROR: 0 when using JoystickAnalog#calibrateJoystick() #277

Closed Answered by moeux
moeux asked this question in Q&A
Discussion options

You must be logged in to vote

My error was solved by switching from auto context to a custom one, as provided in the above linked project.
Context context = Pi4J.newAutoContext();
to

final var piGpio = PiGpio.newNativeInstance();
Context context = Pi4J.newContextBuilder()
                    .noAutoDetect()
                    .add(new RaspberryPiPlatform() {
                        @Override
                        protected String[] getProviders() {
                            return new String[]{};
                        }
                    })
                    .add(PiGpioDigitalInputProvider.newInstance(piGpio),
                            PiGpioDigitalOutputProvider.newInstance(piGpio),
                     …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by moeux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant