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