Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 2:c66aa900dd2f
- Parent:
- 1:e436ca9f7e60
--- a/main.cpp Thu May 07 12:45:43 2015 +0000
+++ b/main.cpp Fri May 08 08:47:26 2015 +0000
@@ -9,6 +9,7 @@
{
ur_Bertl karel;
int beeper = 0;
+ int weg = 0;
while(!karel.IsButtonPressed(BTN_FM))
{
while(!karel.NextToABeeper())
@@ -19,6 +20,7 @@
bt.printf("Beeper: %d", beeper);
karel.Move();
+ weg++;
}
karel.TurnLeft();
@@ -29,4 +31,14 @@
}
karel.TurnLeft();
+
+ for (int a = 0; a < weg; a++)
+ karel.Move();
+
+ karel.TurnLeft();
+
+ for (int a = 0; a < beeper; a++)
+ {
+ karel.Move();
+ }
}
\ No newline at end of file