@@ -0,0 +1,1923 @@
+package com.diozero.sampleapps;%0D%0A%0D%0Aimport org.pmw.tinylog.Logger;%0D%0A%0D%0Aimport com.diozero.api.DigitalInputDevice;%0D%0Aimport com.diozero.api.DigitalOutputDevice;%0D%0A%0D%0A/**%0D%0A * Test switching between input and output modes. To run:%0D%0A * %3Cul%3E%0D%0A * %3Cli%3EJDK Device I/O 1.0:%3Cbr%3E%0D%0A *  %7B@code sudo java -cp tinylog-1.0.3.jar:diozero-core-$DIOZERO_VERSION.jar:diozero-provider-jdkdio10-$DIOZERO_VERSION.jar:dio-1.0.1-dev-linux-armv6hf.jar -Djava.library.path=. com.diozero.sampleapps.InOutTest 12%7D%3C/li%3E%0D%0A * %3Cli%3EJDK Device I/O 1.1:%3Cbr%3E%0D%0A *  %7B@code sudo java -cp tinylog-1.0.3.jar:diozero-core-$DIOZERO_VERSION.jar:diozero-provider-jdkdio11-$DIOZERO_VERSION.jar:dio-1.1-dev-linux-armv6hf.jar -Djava.library.path=. com.diozero.sampleapps.InOutTest 12%7D%3C/li%3E%0D%0A * %3Cli%3EPi4j:%3Cbr%3E%0D%0A *  %7B@code sudo java -cp tinylog-1.0.3.jar:diozero-core-$DIOZERO_VERSION.jar:diozero-provider-pi4j-$DIOZERO_VERSION.jar:pi4j-core-1.1-SNAPSHOT.jar com.diozero.sampleapps.InOutTest 12%7D%3C/li%3E%0D%0A * %3Cli%3EwiringPi:%3Cbr%3E%0D%0A *  %7B@code sudo java -cp tinylog-1.0.3.jar:diozero-core-$DIOZERO_VERSION.jar:diozero-provider-wiringpi-$DIOZERO_VERSION.jar:pi4j-core-1.1-SNAPSHOT.jar com.diozero.sampleapps.InOutTest 12%7D%3C/li%3E%0D%0A * %3Cli%3EpigpgioJ:%3Cbr%3E%0D%0A *  %7B@code sudo java -cp tinylog-1.0.3.jar:diozero-core-$DIOZERO_VERSION.jar:diozero-provider-pigpio-$DIOZERO_VERSION.jar:pigpioj-java-1.0.0.jar com.diozero.sampleapps.InOutTest 12%7D%3C/li%3E%0D%0A * %3C/ul%3E%0D%0A */%0D%0Apublic class InOutTest %7B%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A%09%09if (args.length %3C 1) %7B%0D%0A%09%09%09Logger.error(%22Usage: %7B%7D %3CBCM pin number%3E%22, InOutTest.class.getName());%0D%0A%09%09%09System.exit(1);%0D%0A%09%09%7D%0D%0A%09%09test(Integer.parseInt(args%5B0%5D));%0D%0A%09%7D%0D%0A%09%0D%0A%09public static void test(int pin) %7B%0D%0A%09%09try (DigitalInputDevice in = new DigitalInputDevice(pin)) %7B%0D%0A%09%09%09Logger.info(%22in.getValue(): %22 + in.getValue());%0D%0A%09%09%7D%0D%0A%09%09%0D%0A%09%09try (DigitalOutputDevice out = new DigitalOutputDevice(pin)) %7B%0D%0A%09%09%09out.on();%0D%0A%09%09%09Logger.info(%22out.isOn(): %22 + out.isOn());%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%7D%0D%0A

Test case for issue #3