// SimpleDriveWBL.java // // A program to illustrate the use of the NXT Motors, extended // with a Button Listener // // Simon Parsons // 22nd October 2013 import lejos.nxt.*; // On button presses, start and then stop the motors. public class SimpleDriveWBL{ public static void main(String[] args){ Button.ENTER.addButtonListener(new myButtonListen()); System.out.println("Press any button to start robot"); Button.waitForAnyPress(); LCD.clear(); System.out.println("Press ENTER to stop robot"); Motor.B.forward(); Motor.C.forward(); try{ Thread.sleep(10000);} catch(Exception e){ // Nothing } } }