CntWayHome

Dependencies:   mbed ur_Bertl

Files at this revision

API Documentation at this revision

Comitter:
Markus_Watko
Date:
Thu May 07 12:50:22 2015 +0000
Commit message:
CntWayHome

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 d5d7925ae022 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu May 07 12:50:22 2015 +0000
@@ -0,0 +1,47 @@
+#include "mbed.h"
+#include "ur_Bertl.h"
+#include "const.h"
+
+void MoveHome(int move, ur_Bertl karel)
+{
+   
+    
+    karel.TurnLeft();
+    karel.Move();
+    karel.Move();   
+    karel.Move();
+    
+    karel.TurnLeft();
+    
+    for(int i = 0; i <= move; i++)
+    {
+        karel.Move();
+    }    
+    
+}
+
+
+
+int main() 
+{
+    ur_Bertl karel;
+    
+    int nibble[3] = {0x01, 0x02, 0x03};
+    int cnt = 0;
+    int move = 0;
+    
+    if(karel.NextToABeeper())
+    {
+         wait(1);
+         cnt++;
+         karel.NibbleLeds(nibble[cnt]);   
+         
+         if(cnt == 3)
+         {
+            MoveHome(move, karel);   
+         }
+    }
+    
+    karel.Move();
+    move++;
+}
diff -r 000000000000 -r d5d7925ae022 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu May 07 12:50:22 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8ab26030e058
\ No newline at end of file
diff -r 000000000000 -r d5d7925ae022 ur_Bertl.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ur_Bertl.lib	Thu May 07 12:50:22 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/BERTL_CHEL_18/code/ur_Bertl/#3ce84646fd74