![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Fährt und zählt bis Taster (vorne mitte) feuert, gibt dann aus und dreht nach links
main.cpp
- Committer:
- SebiStr99
- Date:
- 2015-05-08
- Revision:
- 2:693d7cc52ed1
- Parent:
- 1:721291a8c3ee
- Child:
- 3:f92c6d90b328
File content as of revision 2:693d7cc52ed1:
#include "mbed.h" #include "ur_Bertl.h" #include "Beeper_Bertl.h" Serial bt(p9, p10); void main() { Bertl karel; int Beeper = 0; int moves = 0; while(1) { karel.Move(); moves++; if(karel.NextToABeeper()) { Beeper++; bt.printf("%i Beeper", Beeper); karel.Move(); moves++; while(karel.NextToABeeper()) { karel.Move(); moves++; } } bt.printf("Gesamt: Moves: %i; Beeper: %i", moves, Beeper); karel.ShutOff(); } }