/* * 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 * 20060228, Tues; 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) > 2) { //this sig value prototypical // this will interrupt exploreÕs while loop MazeNav.chrono.stop(); MazeNav.different = true; } } }