started with lego stuff
authorMart Lubbers <mart@martlubbers.net>
Wed, 14 Oct 2015 13:47:19 +0000 (15:47 +0200)
committerMart Lubbers <mart@martlubbers.net>
Wed, 14 Oct 2015 13:47:19 +0000 (15:47 +0200)
54 files changed:
mart/ev3/ex1/nl/ru/des/ButtonListener.java [new file with mode: 0644]
mart/ev3/ex1/nl/ru/des/LCDPrintBehaviour.java [new file with mode: 0644]
mart/ev3/ex1/nl/ru/des/Main.java [new file with mode: 0644]
mart/ev3/ex1/nl/ru/des/StayInFieldBehaviour.java [moved from mart/ex10/ex10d.c with 100% similarity]
mart/ev3/ex1/nl/ru/des/WandererBehaviour.java [new file with mode: 0644]
mart/xenomai/ex01/Makefile [moved from mart/ex01/Makefile with 100% similarity]
mart/xenomai/ex01/ex01.c [moved from mart/ex01/ex01.c with 100% similarity]
mart/xenomai/ex01/ex01b.c [moved from mart/ex01/ex01b.c with 100% similarity]
mart/xenomai/ex02/Makefile [moved from mart/ex02/Makefile with 100% similarity]
mart/xenomai/ex02/ex02a.c [moved from mart/ex02/ex02a.c with 100% similarity]
mart/xenomai/ex02/ex02b.c [moved from mart/ex02/ex02b.c with 100% similarity]
mart/xenomai/ex02/ex02c.c [moved from mart/ex02/ex02c.c with 100% similarity]
mart/xenomai/ex02/ex02d.c [moved from mart/ex02/ex02d.c with 100% similarity]
mart/xenomai/ex03/Makefile [moved from mart/ex03/Makefile with 100% similarity]
mart/xenomai/ex03/ex03a.c [moved from mart/ex03/ex03a.c with 100% similarity]
mart/xenomai/ex03/ex03b.c [moved from mart/ex03/ex03b.c with 100% similarity]
mart/xenomai/ex03/ex03c.c [moved from mart/ex03/ex03c.c with 100% similarity]
mart/xenomai/ex03/ex03c1.c [moved from mart/ex03/ex03c1.c with 100% similarity]
mart/xenomai/ex03/ex03c2.c [moved from mart/ex03/ex03c2.c with 100% similarity]
mart/xenomai/ex03/explanations.txt [moved from mart/ex03/explanations.txt with 100% similarity]
mart/xenomai/ex06/Makefile [moved from mart/ex06/Makefile with 100% similarity]
mart/xenomai/ex06/ex06a.c [moved from mart/ex06/ex06a.c with 100% similarity]
mart/xenomai/ex06/ex06b.c [moved from mart/ex06/ex06b.c with 100% similarity]
mart/xenomai/ex06/ex06c.c [moved from mart/ex06/ex06c.c with 100% similarity]
mart/xenomai/ex06/ex06d.c [moved from mart/ex06/ex06d.c with 100% similarity]
mart/xenomai/ex06/explanations.txt [moved from mart/ex06/explanations.txt with 100% similarity]
mart/xenomai/ex07/Makefile [moved from mart/ex07/Makefile with 100% similarity]
mart/xenomai/ex07/ex07a [moved from mart/ex07/ex07a with 100% similarity]
mart/xenomai/ex07/ex07a.c [moved from mart/ex07/ex07a.c with 100% similarity]
mart/xenomai/ex07/ex07b [moved from mart/ex07/ex07b with 100% similarity]
mart/xenomai/ex07/ex07b.c [moved from mart/ex07/ex07b.c with 100% similarity]
mart/xenomai/ex07/ex07c [moved from mart/ex07/ex07c with 100% similarity]
mart/xenomai/ex07/ex07c.c [moved from mart/ex07/ex07c.c with 100% similarity]
mart/xenomai/ex07/explanations.txt [moved from mart/ex07/explanations.txt with 100% similarity]
mart/xenomai/ex08/Makefile [moved from mart/ex08/Makefile with 100% similarity]
mart/xenomai/ex08/ex08a.c [moved from mart/ex08/ex08a.c with 100% similarity]
mart/xenomai/ex08/ex08b.c [moved from mart/ex08/ex08b.c with 100% similarity]
mart/xenomai/ex09/Makefile [moved from mart/ex09/Makefile with 100% similarity]
mart/xenomai/ex09/ex09a1.c [moved from mart/ex09/ex09a1.c with 100% similarity]
mart/xenomai/ex09/ex09a2.c [moved from mart/ex09/ex09a2.c with 100% similarity]
mart/xenomai/ex09/ex09b.c [moved from mart/ex09/ex09b.c with 100% similarity]
mart/xenomai/ex09/explanations.txt [moved from mart/ex09/explanations.txt with 100% similarity]
mart/xenomai/ex10/Makefile [moved from mart/ex10/Makefile with 100% similarity]
mart/xenomai/ex10/ex10a.c [moved from mart/ex10/ex10a.c with 100% similarity]
mart/xenomai/ex10/ex10ab.csv [moved from mart/ex10/ex10ab.csv with 100% similarity]
mart/xenomai/ex10/ex10ab.svg [moved from mart/ex10/ex10ab.svg with 100% similarity]
mart/xenomai/ex10/ex10d.c [new file with mode: 0644]
mart/xenomai/ex10/ex10d.csv [moved from mart/ex10/ex10d.csv with 100% similarity]
mart/xenomai/ex10/ex10d.svg [moved from mart/ex10/ex10d.svg with 100% similarity]
mart/xenomai/ex10/ex10d1.c [moved from mart/ex10/ex10d1.c with 100% similarity]
mart/xenomai/ex10/ex10d2.c [moved from mart/ex10/ex10d2.c with 100% similarity]
mart/xenomai/ex10/plots.m [moved from mart/ex10/plots.m with 100% similarity]
mart/xenomai/ex11/Makefile [moved from mart/ex11/Makefile with 100% similarity]
mart/xenomai/ex11/ex11.c [moved from mart/ex11/ex11.c with 100% similarity]

diff --git a/mart/ev3/ex1/nl/ru/des/ButtonListener.java b/mart/ev3/ex1/nl/ru/des/ButtonListener.java
new file mode 100644 (file)
index 0000000..0f7ef44
--- /dev/null
@@ -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 (file)
index 0000000..cd5b58b
--- /dev/null
@@ -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 (file)
index 0000000..c8a1b5b
--- /dev/null
@@ -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/ev3/ex1/nl/ru/des/WandererBehaviour.java b/mart/ev3/ex1/nl/ru/des/WandererBehaviour.java
new file mode 100644 (file)
index 0000000..66e85f6
--- /dev/null
@@ -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
similarity index 100%
rename from mart/ex01/ex01.c
rename to mart/xenomai/ex01/ex01.c
similarity index 100%
rename from mart/ex01/ex01b.c
rename to mart/xenomai/ex01/ex01b.c
similarity index 100%
rename from mart/ex02/ex02a.c
rename to mart/xenomai/ex02/ex02a.c
similarity index 100%
rename from mart/ex02/ex02b.c
rename to mart/xenomai/ex02/ex02b.c
similarity index 100%
rename from mart/ex02/ex02c.c
rename to mart/xenomai/ex02/ex02c.c
similarity index 100%
rename from mart/ex02/ex02d.c
rename to mart/xenomai/ex02/ex02d.c
similarity index 100%
rename from mart/ex03/ex03a.c
rename to mart/xenomai/ex03/ex03a.c
similarity index 100%
rename from mart/ex03/ex03b.c
rename to mart/xenomai/ex03/ex03b.c
similarity index 100%
rename from mart/ex03/ex03c.c
rename to mart/xenomai/ex03/ex03c.c
similarity index 100%
rename from mart/ex06/ex06a.c
rename to mart/xenomai/ex06/ex06a.c
similarity index 100%
rename from mart/ex06/ex06b.c
rename to mart/xenomai/ex06/ex06b.c
similarity index 100%
rename from mart/ex06/ex06c.c
rename to mart/xenomai/ex06/ex06c.c
similarity index 100%
rename from mart/ex06/ex06d.c
rename to mart/xenomai/ex06/ex06d.c
similarity index 100%
rename from mart/ex07/ex07a
rename to mart/xenomai/ex07/ex07a
similarity index 100%
rename from mart/ex07/ex07a.c
rename to mart/xenomai/ex07/ex07a.c
similarity index 100%
rename from mart/ex07/ex07b
rename to mart/xenomai/ex07/ex07b
similarity index 100%
rename from mart/ex07/ex07b.c
rename to mart/xenomai/ex07/ex07b.c
similarity index 100%
rename from mart/ex07/ex07c
rename to mart/xenomai/ex07/ex07c
similarity index 100%
rename from mart/ex07/ex07c.c
rename to mart/xenomai/ex07/ex07c.c
similarity index 100%
rename from mart/ex08/ex08a.c
rename to mart/xenomai/ex08/ex08a.c
similarity index 100%
rename from mart/ex08/ex08b.c
rename to mart/xenomai/ex08/ex08b.c
similarity index 100%
rename from mart/ex09/ex09b.c
rename to mart/xenomai/ex09/ex09b.c
similarity index 100%
rename from mart/ex10/ex10a.c
rename to mart/xenomai/ex10/ex10a.c
diff --git a/mart/xenomai/ex10/ex10d.c b/mart/xenomai/ex10/ex10d.c
new file mode 100644 (file)
index 0000000..e69de29
similarity index 100%
rename from mart/ex10/plots.m
rename to mart/xenomai/ex10/plots.m
similarity index 100%
rename from mart/ex11/ex11.c
rename to mart/xenomai/ex11/ex11.c