Versuch 2

Dependencies:   mbed

Committer:
Dominik32
Date:
Thu Apr 23 12:12:01 2015 +0000
Revision:
1:5bcd7fd92f60
Parent:
0:363abd3fc535
Child:
2:0e1b409ff333
Zum Beeper fahren

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Dominik32 0:363abd3fc535 1 #include "mbed.h"
Dominik32 0:363abd3fc535 2 #include "ur_Bertl.h"
Dominik32 0:363abd3fc535 3 #include "const.h"
Dominik32 0:363abd3fc535 4 #include "Alle_Befehle.h"
Dominik32 0:363abd3fc535 5
Dominik32 1:5bcd7fd92f60 6
Dominik32 1:5bcd7fd92f60 7
Dominik32 1:5bcd7fd92f60 8
Dominik32 1:5bcd7fd92f60 9
Dominik32 1:5bcd7fd92f60 10 /*
Dominik32 1:5bcd7fd92f60 11 int main()
Dominik32 1:5bcd7fd92f60 12 {
Dominik32 1:5bcd7fd92f60 13 ur_Bertl karel;
Dominik32 1:5bcd7fd92f60 14 while( !karel.NextToABeeper() )
Dominik32 1:5bcd7fd92f60 15 {
Dominik32 1:5bcd7fd92f60 16 karel.Move();
Dominik32 1:5bcd7fd92f60 17 }
Dominik32 1:5bcd7fd92f60 18 karel.PickBeeper();
Dominik32 1:5bcd7fd92f60 19
Dominik32 1:5bcd7fd92f60 20 }
Dominik32 1:5bcd7fd92f60 21
Dominik32 1:5bcd7fd92f60 22 */
Dominik32 1:5bcd7fd92f60 23
Dominik32 1:5bcd7fd92f60 24
Dominik32 1:5bcd7fd92f60 25
Dominik32 1:5bcd7fd92f60 26
Dominik32 0:363abd3fc535 27 int main()
Dominik32 0:363abd3fc535 28 {
Dominik32 1:5bcd7fd92f60 29 ur_Bertl karel;
Dominik32 1:5bcd7fd92f60 30 int z = 0;
Dominik32 0:363abd3fc535 31
Dominik32 1:5bcd7fd92f60 32 while(1)
Dominik32 0:363abd3fc535 33 {
Dominik32 1:5bcd7fd92f60 34 if(karel.NextToABeeper())
Dominik32 1:5bcd7fd92f60 35 {
Dominik32 1:5bcd7fd92f60 36 z = z++;
Dominik32 1:5bcd7fd92f60 37 if(z == 1)
Dominik32 1:5bcd7fd92f60 38 {
Dominik32 1:5bcd7fd92f60 39 karel.RGBLed(1,0,0);
Dominik32 1:5bcd7fd92f60 40 }
Dominik32 1:5bcd7fd92f60 41
Dominik32 1:5bcd7fd92f60 42 else if(z == 2)
Dominik32 1:5bcd7fd92f60 43 {
Dominik32 1:5bcd7fd92f60 44 karel.RGBLed(0,1,0);
Dominik32 1:5bcd7fd92f60 45 }
Dominik32 1:5bcd7fd92f60 46
Dominik32 1:5bcd7fd92f60 47 else if(z > 2)
Dominik32 1:5bcd7fd92f60 48 {
Dominik32 1:5bcd7fd92f60 49 karel.RGBLed(0,0,1);
Dominik32 1:5bcd7fd92f60 50 }
Dominik32 1:5bcd7fd92f60 51
Dominik32 1:5bcd7fd92f60 52 }
Dominik32 0:363abd3fc535 53 karel.Move();
Dominik32 0:363abd3fc535 54
Dominik32 0:363abd3fc535 55 }
Dominik32 1:5bcd7fd92f60 56 }