/* * This tiny class operates the SensorListeners for MazeNav. * This is looking for a significant change in light values, which signify that * it has come to something interesting navigationally. It should then throw an * exception to MazeNav.explore(), but maybe it wonÕt. * * ********************** * Julie Powers-Boyle * 20060224, Fri; Programming WS * $id * ********************** */ import josx.platform.rcx.*; public class LightWatcher implements SensorListener{ public void stateChanged(Sensor whichSensor, int lastValue, int newValue){ if (Math.abs(lastValue - newValue) > 1) { //this sig value prototypical // tell explore to have an event like stopping InterruptedException e; } } }