--- /dev/null
+package nl.ru.des;
+
+import lejos.hardware.Key;
+import lejos.hardware.KeyListener;
+import lejos.hardware.lcd.LCD;
+import lejos.utility.Delay;
+
+class ButtonListener implements KeyListener {
+ @Override
+ public void keyPressed(Key k) {
+ LCD.clear();
+ LCD.drawString("Bye...", 0, 0);
+ Delay.msDelay(500);
+ System.exit(0);
+ }
+
+ @Override
+ public void keyReleased(Key k) {}
+}
\ No newline at end of file
--- /dev/null
+package nl.ru.des;
+
+import lejos.robotics.subsumption.Behavior;
+
+class LCDPrintr implements Behavior{
+
+ @Override
+ public boolean takeControl() {
+ return false;
+ }
+
+ @Override
+ public void action() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void suppress() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
\ No newline at end of file
--- /dev/null
+package nl.ru.des;
+
+import lejos.hardware.ev3.LocalEV3;
+import lejos.robotics.subsumption.Arbitrator;
+import lejos.robotics.subsumption.Behavior;
+
+public class Main {
+
+ public static void main(String[] args) {
+ LocalEV3.get().getKey("Escape").addKeyListener(new ButtonListener());
+ Behavior[] behaviorList = new Behavior[]{
+ new WandererBehaviour(),
+ //new StayInFieldBehaviour(),
+ };
+ Arbitrator arb = new Arbitrator(behaviorList);
+ arb.start();
+ }
+}
--- /dev/null
+package nl.ru.des;
+
+import lejos.hardware.motor.EV3LargeRegulatedMotor;
+import lejos.hardware.port.MotorPort;
+import lejos.robotics.subsumption.Behavior;
+
+public class WandererBehaviour implements Behavior {
+ private EV3LargeRegulatedMotor leftMotor, rightMotor;
+
+ public WandererBehaviour(){
+ leftMotor = new EV3LargeRegulatedMotor(MotorPort.A);
+ leftMotor.setSpeed(10000);
+ rightMotor = new EV3LargeRegulatedMotor(MotorPort.D);
+ rightMotor.setSpeed(10000);
+ }
+
+ @Override
+ public boolean takeControl() {
+ return true;
+ }
+
+ @Override
+ public void action() {
+ leftMotor.forward();
+ rightMotor.forward();
+ }
+
+ @Override
+ public void suppress() {
+ leftMotor.stop(true);
+ rightMotor.stop();
+ }
+}
\ No newline at end of file