From: Mart Lubbers Date: Wed, 14 Oct 2015 13:47:19 +0000 (+0200) Subject: started with lego stuff X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=0cf9f37fd6cc5daeaf41c11f683a868a1d9208a3;p=des2015.git started with lego stuff --- diff --git a/mart/ev3/ex1/nl/ru/des/ButtonListener.java b/mart/ev3/ex1/nl/ru/des/ButtonListener.java new file mode 100644 index 0000000..0f7ef44 --- /dev/null +++ b/mart/ev3/ex1/nl/ru/des/ButtonListener.java @@ -0,0 +1,19 @@ +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 diff --git a/mart/ev3/ex1/nl/ru/des/LCDPrintBehaviour.java b/mart/ev3/ex1/nl/ru/des/LCDPrintBehaviour.java new file mode 100644 index 0000000..cd5b58b --- /dev/null +++ b/mart/ev3/ex1/nl/ru/des/LCDPrintBehaviour.java @@ -0,0 +1,24 @@ +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 diff --git a/mart/ev3/ex1/nl/ru/des/Main.java b/mart/ev3/ex1/nl/ru/des/Main.java new file mode 100644 index 0000000..c8a1b5b --- /dev/null +++ b/mart/ev3/ex1/nl/ru/des/Main.java @@ -0,0 +1,18 @@ +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(); + } +} diff --git a/mart/ex10/ex10d.c b/mart/ev3/ex1/nl/ru/des/StayInFieldBehaviour.java similarity index 100% rename from mart/ex10/ex10d.c rename to mart/ev3/ex1/nl/ru/des/StayInFieldBehaviour.java diff --git a/mart/ev3/ex1/nl/ru/des/WandererBehaviour.java b/mart/ev3/ex1/nl/ru/des/WandererBehaviour.java new file mode 100644 index 0000000..66e85f6 --- /dev/null +++ b/mart/ev3/ex1/nl/ru/des/WandererBehaviour.java @@ -0,0 +1,33 @@ +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 diff --git a/mart/ex01/Makefile b/mart/xenomai/ex01/Makefile similarity index 100% rename from mart/ex01/Makefile rename to mart/xenomai/ex01/Makefile diff --git a/mart/ex01/ex01.c b/mart/xenomai/ex01/ex01.c similarity index 100% rename from mart/ex01/ex01.c rename to mart/xenomai/ex01/ex01.c diff --git a/mart/ex01/ex01b.c b/mart/xenomai/ex01/ex01b.c similarity index 100% rename from mart/ex01/ex01b.c rename to mart/xenomai/ex01/ex01b.c diff --git a/mart/ex02/Makefile b/mart/xenomai/ex02/Makefile similarity index 100% rename from mart/ex02/Makefile rename to mart/xenomai/ex02/Makefile diff --git a/mart/ex02/ex02a.c b/mart/xenomai/ex02/ex02a.c similarity index 100% rename from mart/ex02/ex02a.c rename to mart/xenomai/ex02/ex02a.c diff --git a/mart/ex02/ex02b.c b/mart/xenomai/ex02/ex02b.c similarity index 100% rename from mart/ex02/ex02b.c rename to mart/xenomai/ex02/ex02b.c diff --git a/mart/ex02/ex02c.c b/mart/xenomai/ex02/ex02c.c similarity index 100% rename from mart/ex02/ex02c.c rename to mart/xenomai/ex02/ex02c.c diff --git a/mart/ex02/ex02d.c b/mart/xenomai/ex02/ex02d.c similarity index 100% rename from mart/ex02/ex02d.c rename to mart/xenomai/ex02/ex02d.c diff --git a/mart/ex03/Makefile b/mart/xenomai/ex03/Makefile similarity index 100% rename from mart/ex03/Makefile rename to mart/xenomai/ex03/Makefile diff --git a/mart/ex03/ex03a.c b/mart/xenomai/ex03/ex03a.c similarity index 100% rename from mart/ex03/ex03a.c rename to mart/xenomai/ex03/ex03a.c diff --git a/mart/ex03/ex03b.c b/mart/xenomai/ex03/ex03b.c similarity index 100% rename from mart/ex03/ex03b.c rename to mart/xenomai/ex03/ex03b.c diff --git a/mart/ex03/ex03c.c b/mart/xenomai/ex03/ex03c.c similarity index 100% rename from mart/ex03/ex03c.c rename to mart/xenomai/ex03/ex03c.c diff --git a/mart/ex03/ex03c1.c b/mart/xenomai/ex03/ex03c1.c similarity index 100% rename from mart/ex03/ex03c1.c rename to mart/xenomai/ex03/ex03c1.c diff --git a/mart/ex03/ex03c2.c b/mart/xenomai/ex03/ex03c2.c similarity index 100% rename from mart/ex03/ex03c2.c rename to mart/xenomai/ex03/ex03c2.c diff --git a/mart/ex03/explanations.txt b/mart/xenomai/ex03/explanations.txt similarity index 100% rename from mart/ex03/explanations.txt rename to mart/xenomai/ex03/explanations.txt diff --git a/mart/ex06/Makefile b/mart/xenomai/ex06/Makefile similarity index 100% rename from mart/ex06/Makefile rename to mart/xenomai/ex06/Makefile diff --git a/mart/ex06/ex06a.c b/mart/xenomai/ex06/ex06a.c similarity index 100% rename from mart/ex06/ex06a.c rename to mart/xenomai/ex06/ex06a.c diff --git a/mart/ex06/ex06b.c b/mart/xenomai/ex06/ex06b.c similarity index 100% rename from mart/ex06/ex06b.c rename to mart/xenomai/ex06/ex06b.c diff --git a/mart/ex06/ex06c.c b/mart/xenomai/ex06/ex06c.c similarity index 100% rename from mart/ex06/ex06c.c rename to mart/xenomai/ex06/ex06c.c diff --git a/mart/ex06/ex06d.c b/mart/xenomai/ex06/ex06d.c similarity index 100% rename from mart/ex06/ex06d.c rename to mart/xenomai/ex06/ex06d.c diff --git a/mart/ex06/explanations.txt b/mart/xenomai/ex06/explanations.txt similarity index 100% rename from mart/ex06/explanations.txt rename to mart/xenomai/ex06/explanations.txt diff --git a/mart/ex07/Makefile b/mart/xenomai/ex07/Makefile similarity index 100% rename from mart/ex07/Makefile rename to mart/xenomai/ex07/Makefile diff --git a/mart/ex07/ex07a b/mart/xenomai/ex07/ex07a similarity index 100% rename from mart/ex07/ex07a rename to mart/xenomai/ex07/ex07a diff --git a/mart/ex07/ex07a.c b/mart/xenomai/ex07/ex07a.c similarity index 100% rename from mart/ex07/ex07a.c rename to mart/xenomai/ex07/ex07a.c diff --git a/mart/ex07/ex07b b/mart/xenomai/ex07/ex07b similarity index 100% rename from mart/ex07/ex07b rename to mart/xenomai/ex07/ex07b diff --git a/mart/ex07/ex07b.c b/mart/xenomai/ex07/ex07b.c similarity index 100% rename from mart/ex07/ex07b.c rename to mart/xenomai/ex07/ex07b.c diff --git a/mart/ex07/ex07c b/mart/xenomai/ex07/ex07c similarity index 100% rename from mart/ex07/ex07c rename to mart/xenomai/ex07/ex07c diff --git a/mart/ex07/ex07c.c b/mart/xenomai/ex07/ex07c.c similarity index 100% rename from mart/ex07/ex07c.c rename to mart/xenomai/ex07/ex07c.c diff --git a/mart/ex07/explanations.txt b/mart/xenomai/ex07/explanations.txt similarity index 100% rename from mart/ex07/explanations.txt rename to mart/xenomai/ex07/explanations.txt diff --git a/mart/ex08/Makefile b/mart/xenomai/ex08/Makefile similarity index 100% rename from mart/ex08/Makefile rename to mart/xenomai/ex08/Makefile diff --git a/mart/ex08/ex08a.c b/mart/xenomai/ex08/ex08a.c similarity index 100% rename from mart/ex08/ex08a.c rename to mart/xenomai/ex08/ex08a.c diff --git a/mart/ex08/ex08b.c b/mart/xenomai/ex08/ex08b.c similarity index 100% rename from mart/ex08/ex08b.c rename to mart/xenomai/ex08/ex08b.c diff --git a/mart/ex09/Makefile b/mart/xenomai/ex09/Makefile similarity index 100% rename from mart/ex09/Makefile rename to mart/xenomai/ex09/Makefile diff --git a/mart/ex09/ex09a1.c b/mart/xenomai/ex09/ex09a1.c similarity index 100% rename from mart/ex09/ex09a1.c rename to mart/xenomai/ex09/ex09a1.c diff --git a/mart/ex09/ex09a2.c b/mart/xenomai/ex09/ex09a2.c similarity index 100% rename from mart/ex09/ex09a2.c rename to mart/xenomai/ex09/ex09a2.c diff --git a/mart/ex09/ex09b.c b/mart/xenomai/ex09/ex09b.c similarity index 100% rename from mart/ex09/ex09b.c rename to mart/xenomai/ex09/ex09b.c diff --git a/mart/ex09/explanations.txt b/mart/xenomai/ex09/explanations.txt similarity index 100% rename from mart/ex09/explanations.txt rename to mart/xenomai/ex09/explanations.txt diff --git a/mart/ex10/Makefile b/mart/xenomai/ex10/Makefile similarity index 100% rename from mart/ex10/Makefile rename to mart/xenomai/ex10/Makefile diff --git a/mart/ex10/ex10a.c b/mart/xenomai/ex10/ex10a.c similarity index 100% rename from mart/ex10/ex10a.c rename to mart/xenomai/ex10/ex10a.c diff --git a/mart/ex10/ex10ab.csv b/mart/xenomai/ex10/ex10ab.csv similarity index 100% rename from mart/ex10/ex10ab.csv rename to mart/xenomai/ex10/ex10ab.csv diff --git a/mart/ex10/ex10ab.svg b/mart/xenomai/ex10/ex10ab.svg similarity index 100% rename from mart/ex10/ex10ab.svg rename to mart/xenomai/ex10/ex10ab.svg diff --git a/mart/xenomai/ex10/ex10d.c b/mart/xenomai/ex10/ex10d.c new file mode 100644 index 0000000..e69de29 diff --git a/mart/ex10/ex10d.csv b/mart/xenomai/ex10/ex10d.csv similarity index 100% rename from mart/ex10/ex10d.csv rename to mart/xenomai/ex10/ex10d.csv diff --git a/mart/ex10/ex10d.svg b/mart/xenomai/ex10/ex10d.svg similarity index 100% rename from mart/ex10/ex10d.svg rename to mart/xenomai/ex10/ex10d.svg diff --git a/mart/ex10/ex10d1.c b/mart/xenomai/ex10/ex10d1.c similarity index 100% rename from mart/ex10/ex10d1.c rename to mart/xenomai/ex10/ex10d1.c diff --git a/mart/ex10/ex10d2.c b/mart/xenomai/ex10/ex10d2.c similarity index 100% rename from mart/ex10/ex10d2.c rename to mart/xenomai/ex10/ex10d2.c diff --git a/mart/ex10/plots.m b/mart/xenomai/ex10/plots.m similarity index 100% rename from mart/ex10/plots.m rename to mart/xenomai/ex10/plots.m diff --git a/mart/ex11/Makefile b/mart/xenomai/ex11/Makefile similarity index 100% rename from mart/ex11/Makefile rename to mart/xenomai/ex11/Makefile diff --git a/mart/ex11/ex11.c b/mart/xenomai/ex11/ex11.c similarity index 100% rename from mart/ex11/ex11.c rename to mart/xenomai/ex11/ex11.c