// LTouchListener.java // // A sensor port Listener. In this case one we expect to attach to the left // touch sensor. // // Simon Parsons // 22nd October 2013 import lejos.nxt.*; public class LTouchListener implements SensorPortListener{ // To provide a sensor port listener, we have to implement this function. public void stateChanged(SensorPort port, int oldValue, int newValue){ // We use the change in raw port value to decide what to do. if(newValue <500){ Motor.B.stop(); Motor.C.stop(); } } }