package RCX2; import josx.platform.rcx.*; /** *A program that will make an RCX follow a black line. When it encounters an *obstacle it will find its way around and continue on the line. * *main class. Handles all events by directing the other classes to take * appropriate action. */ public class CapnKirk{ //BEGIN MAIN =================================================================== public static void main(String [] args) throws Exception { Pilot.init(); Sensors.init(); ProgramListener programBT = new ProgramListener(); Button.PRGM.addButtonListener(programBT); TextLCD.print("Inid"); while(true){;} }//main //END MAIN ===================================================================== /** *Decides what to do if the light sensor is triggered. *@param lit If light or dark, true/false respectively. */ public static void lit(boolean lit){ if (lit == true){ ; } if (lit == false){ ; } } /** *Decides what to do if the touch listener is triggered. */ public static void bumped(){ Pilot.engine.stop(); Pilot.steer.rotateTo(Sensor.S2.readValue()+1); try{Thread.sleep(500);}catch(InterruptedException ie){} Pilot.steer.rotateTo(Sensor.S2.readValue()-1); }//bumped /** *A listener for the Program button. */ private static class ProgramListener implements ButtonListener { public void buttonPressed(Button b){ ; }//buttonPressed() public void buttonReleased(Button b){ Pilot.forward(0,4); }//buttonReleased() }//prgmListener }//CapnKirk