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.
You are viewing an older revision! See the latest version
Beeper zaehlen
Bertl fährt bis zu einer Mauer. Auf dem Weg zählt er die Beeper, ist er bei der Mauer, dreht er sich nach links und die Anzahl der Beeper wieder hinauf.
https://developer.mbed.org/users/sophia/code/BeeperZaehlen/
main.cpp
Serial bt(p9, p10); int main () { ur_Bertl karel; int beeper = 0; while(!karel.IsButtonPressed(BTN_FM)) { while(!karel.NextToABeeper()) { karel.Move(); } beeper++; bt.printf("Beeper: %d", beeper); karel.Move(); } karel.TurnLeft(); for (int a = 0; a < beeper; a++) { karel.Move(); } karel.TurnLeft(); }