//Create a digital input object DigitalInputChannel dig = new DigitalInputChannel(dyio.getChannel(8)); //Loop forever printing out the state of the button while(!Thread.interrupted()){ System.out.println(dig.isHigh()); Thread.sleep(1); }