While Aufgabe mit Beeper

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
asdfmaker333
Date:
Fri Apr 24 08:42:57 2015 +0000
Commit message:
While_Task3 Funktioniert

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 f4fa6a572eca main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Apr 24 08:42:57 2015 +0000
@@ -0,0 +1,55 @@
+#include "ur_Bertl.h"
+#include "mbed.h"
+#include "const.h"
+
+class WhileAufgabe : public ur_Bertl
+{
+ public: 
+ 
+ void MoveOnBeeper();
+ 
+    
+};
+
+void WhileAufgabe :: MoveOnBeeper()
+{
+    
+    int x = 0;
+    TurnLeft();
+    while(NextToABeeper())
+    {
+     Move();
+     x++;
+    }
+    
+    TurnLeft();
+    TurnLeft();
+    while(x > 0)
+    {
+    Move();
+    x--;
+    }
+    TurnLeft();
+    Move();
+}
+
+
+int main()
+{
+    WhileAufgabe karel;   
+    
+    while(karel.FrontIsClear())
+    {
+        if(karel.NextToABeeper())
+        {
+            karel.MoveOnBeeper();
+        }
+        else
+        {
+            karel.Move();   
+            
+         }
+    }
+    karel.ShutOff();
+  
+}
\ No newline at end of file
diff -r 000000000000 -r f4fa6a572eca mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Apr 24 08:42:57 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/433970e64889
\ No newline at end of file
diff -r 000000000000 -r f4fa6a572eca ur_Bertl.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ur_Bertl.lib	Fri Apr 24 08:42:57 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/BERTL_CHEL_18/code/ur_Bertl/#07e55b300ff1