Bewegt sich bis 3 Beeper erreicht sind und dann zum Ursprung zurück

Dependencies:   mbed ur_Bertl

Meine Projekte

Dieses Projekte habe ich im SS 2015 in FSST programmiert.
Task_if : Programm

Files at this revision

API Documentation at this revision

Comitter:
feldgrill1
Date:
Thu May 07 12:50:01 2015 +0000
Commit message:
Beeper Z?hler

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
ur_Bertl.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 6457ead43290 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu May 07 12:50:01 2015 +0000
@@ -0,0 +1,59 @@
+#include "mbed.h"
+#include "ur_Bertl.h"
+#include "const.h"
+#include "Robot.h"
+
+Serial bt(p9, p10);
+
+
+void main ()
+{
+//    int xy = 5;
+    
+//    while(true){
+//        bt.printf("Hello Bertl: %d\n", xy);
+//        wait(1);}
+
+    ur_Bertl karel;
+
+    int count = 0;
+    int dist = 0;
+
+
+    while (true) {
+
+        
+
+        if (!karel.NextToABeeper()) {
+            karel.Move();
+            dist++;
+                    
+            bt.printf("Move: %d\n", dist);
+            wait(1);
+        }
+
+        if (karel.NextToABeeper()) {
+            karel.Move();
+            dist++;
+            count++;
+            
+            bt.printf("Move: %d\n", dist);
+            bt.printf("Beeper: %d\n", count);
+            wait(1);
+        }
+
+        if (count == 3) {
+            karel.TurnLeft();
+            karel.Move();
+            karel.TurnLeft();
+            for ( int x = 0; x < count; x++)
+                karel.Move();
+            karel.TurnLeft();
+            karel.Move();
+            karel.TurnLeft();
+        }
+    }
+        
+    
+    
+}
\ No newline at end of file
diff -r 000000000000 -r 6457ead43290 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu May 07 12:50:01 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9ad691361fac
\ No newline at end of file
diff -r 000000000000 -r 6457ead43290 ur_Bertl.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ur_Bertl.lib	Thu May 07 12:50:01 2015 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/BERTL_CHEL_18/code/ur_Bertl/#3ce84646fd74