GoToBeeper2

Dependencies:   mbed

Revision:
0:58c13a57ed81
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Apr 24 08:11:28 2015 +0000
@@ -0,0 +1,42 @@
+#include "mbed.h"
+#include "ur_Bertl.h"
+
+
+
+
+int main() 
+{
+    ur_Bertl karel;
+    
+    bool x = true;
+    int cnt = 0;
+    
+    do
+    {
+        karel.Move();
+    
+        if (karel.IsButtonPressed(0x80))
+        {
+            for(int i = 0; i <= 5; i++)
+            {
+                karel.NibbleLeds(0x0F);
+                wait(0.1);
+                karel.NibbleLeds(0x00);
+                wait(0.1);
+                cnt++;
+            }
+            
+            if ( cnt >= 2)
+            {
+                x = false;    
+            }
+            
+            karel.MoveBackwards();
+            karel.TurnLeft(); 
+           
+           
+        }   
+        
+       
+    }while(x);
+}