Minor bugfixes when quitting.
This commit is contained in:
@@ -49,9 +49,13 @@ public class NxtAR_bot{
|
||||
}
|
||||
bluetoothConnection.close();
|
||||
}
|
||||
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public static void main(String[] args){
|
||||
Button.ESCAPE.addButtonListener(new QuitButtonListener());
|
||||
|
||||
Motor.A.resetTachoCount();
|
||||
Motor.B.resetTachoCount();
|
||||
Motor.C.resetTachoCount();
|
||||
@@ -59,18 +63,16 @@ public class NxtAR_bot{
|
||||
LightSensor lightSensor = new LightSensor(SensorPort.S1);
|
||||
lightSensor.setFloodlight(false);
|
||||
|
||||
System.out.println("Point at dark and press ENTER");
|
||||
System.out.println("Point at dark\nand press ENTER");
|
||||
Button.ENTER.waitForPress();
|
||||
lightSensor.calibrateLow();
|
||||
System.out.println("--/--");
|
||||
|
||||
System.out.println("Point at light and press ENTER");
|
||||
System.out.println("Point at light\nand press ENTER");
|
||||
Button.ENTER.waitForPress();
|
||||
lightSensor.calibrateHigh();
|
||||
System.out.println("--/--");
|
||||
|
||||
Button.ESCAPE.addButtonListener(new QuitButtonListener());
|
||||
|
||||
bluetoothConnection = Bluetooth.waitForConnection();
|
||||
bluetoothConnection.setIOMode(NXTConnection.RAW);
|
||||
dataOutputStream = bluetoothConnection.openDataOutputStream();
|
||||
|
||||
Reference in New Issue
Block a user