Bertl fährt und zählt Beeper

Dependencies:   mbed ur_Bertl

Meine Programme

neue Zeile = \ \

Bertl fährt und zählt beeper

main.cpp

void main()
{
    urBertl karel;
    int beeper = 0;
    
    while(karel.FrontIsClear)
    {
        while(!karel.NextToABeeper())
        {
            karel.Move();
        }
        beeper++;
        bt.print("Beeper: %d", beeper);
        
        karel.Move();
    }
    
    karel.TurnLeft();
    
    for(int a = 0; a < beeper; a++)
        karel.Move();
        
    karel.TurnLeft();
}

2nd-Page

Files at this revision

API Documentation at this revision

Comitter:
Jannis
Date:
Thu May 07 12:11:42 2015 +0000
Commit message:
Bertl f?hrt und z?hlt Beeper

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 2db4b2b9cf3c main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu May 07 12:11:42 2015 +0000
@@ -0,0 +1,74 @@
+#include "mbed.h"
+#include "ur_Bertl.h"
+#include "const.h"
+
+void main()
+{
+    urBertl karel;
+    int beeper = 0;
+    
+    while(karel.FrontIsClear)
+    {
+        while(!karel.NextToABeeper())
+        {
+            karel.Move();
+        }
+        beeper++;
+        karel.Move();
+    }
+    
+    karel.TurnLeft();
+    
+    for(int a = 0; a < beeper; a++)
+        karel.Move();
+        
+    karel.TurnLeft();
+}
+
+/*Serial bt(p9, p10);
+
+void main()
+{
+    int xy = 5;
+    
+    while(true)
+    {
+        bt.print("Hello Bertl: %d \n", xy);
+        wait(1);
+    }
+}
+
+class Bertl : public ur_Bertl
+{public:
+    void ClearAllBeepersToTheWall();
+};
+
+void Bertl :: ClearAllBeepersToTheWall()
+{
+    while(FrontIsClear())
+    {
+        Move();
+        PickBeeper();
+    }
+}
+
+int main()
+{   
+    Bertl karel;
+    
+    karel.ClearAllBeepersToTheWall();
+
+    while(!karel.NextToABeeper())
+    {
+        karel.Move();
+    }
+    karel.PickBeeper();
+    
+    if ( !karel.NextToABeeper())
+        karel.Move();
+    if ( !karel.NextToABeeper())
+        karel.Move();
+    if ( !karel.NextToABeeper())
+        karel.Move();
+    karel.PickBeeper();
+}*/
\ No newline at end of file
diff -r 000000000000 -r 2db4b2b9cf3c mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu May 07 12:11:42 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 2db4b2b9cf3c ur_Bertl.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ur_Bertl.lib	Thu May 07 12:11:42 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/BERTL_CHEL_18/code/ur_Bertl/#207a1e646191