All pastes #1240757 Raw Edit

BBVehicle1.java

public java v1 · immutable
#1240757 ·published 2008-10-30 17:14 UTC
rendered paste body
import lejos.nxt.*;public class BBVehicle1{  public static void main (String[] aArg)  throws Exception  {	RCXLightSensor lightSensor = new RCXLightSensor(SensorPort.S3);	MotorPort[] motors = new MotorPort[] { MotorPort.A, MotorPort.B };	SensorActuatorConnection thread = new SensorActuatorConnection(lightSensor, motors, "v1");	thread.setDaemon(true);		LCD.clear();	LCD.drawString("Press ENTER to start", 0, 0);	 	while (Button.ENTER.isPressed()){}	while (! Button.ENTER.isPressed()){}	thread.start();		while (! Button.ESCAPE.isPressed())	{		 	}		while (! Button.ENTER.isPressed()){}	thread.interrupt();    LCD.drawString("Program stopped", 0, 0);    LCD.refresh();   }}