Sammelt Beeper ein und NibbelLeds zählen wie viele Beeper in der Tasche sind :)

Dependencies:   mbed

Committer:
martinale
Date:
Fri Apr 24 08:03:47 2015 +0000
Revision:
0:8bd44a190572
Sammelt Beeper ein und NibbelLeds z?hlen wie viele Beeper in der Tasche sind :)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
martinale 0:8bd44a190572 1 #include "mbed.h"
martinale 0:8bd44a190572 2 #include "Robot.h"
martinale 0:8bd44a190572 3 #include "const.h"
martinale 0:8bd44a190572 4
martinale 0:8bd44a190572 5 class Bertl_Beeper : public Robot
martinale 0:8bd44a190572 6 {
martinale 0:8bd44a190572 7 public:
martinale 0:8bd44a190572 8 void ClearAllBeeperToTheWall();
martinale 0:8bd44a190572 9 };
martinale 0:8bd44a190572 10
martinale 0:8bd44a190572 11 void Bertl_Beeper :: ClearAllBeeperToTheWall()
martinale 0:8bd44a190572 12 {
martinale 0:8bd44a190572 13 while(FrontIsClear())
martinale 0:8bd44a190572 14 {
martinale 0:8bd44a190572 15 if(NextToABeeper())
martinale 0:8bd44a190572 16 {
martinale 0:8bd44a190572 17 PickBeeper();
martinale 0:8bd44a190572 18 NibbleLeds(AnyBeeperInBag());
martinale 0:8bd44a190572 19 wait(1);
martinale 0:8bd44a190572 20 Move();
martinale 0:8bd44a190572 21 }
martinale 0:8bd44a190572 22 else
martinale 0:8bd44a190572 23 Move();
martinale 0:8bd44a190572 24 }
martinale 0:8bd44a190572 25 }
martinale 0:8bd44a190572 26
martinale 0:8bd44a190572 27 int main()
martinale 0:8bd44a190572 28 {
martinale 0:8bd44a190572 29 Bertl_Beeper karel;
martinale 0:8bd44a190572 30
martinale 0:8bd44a190572 31 karel.ClearAllBeeperToTheWall();
martinale 0:8bd44a190572 32
martinale 0:8bd44a190572 33 }