Task 3
Fork of Liniensensor_2 by
Mein Projekt:
Dieses Projekt habe ich im SS 2015 in FSST programmiert 3. While Task
main.cpp@4:d69d779e204b, 2015-04-24 (annotated)
- Committer:
- Dominik32
- Date:
- Fri Apr 24 08:09:42 2015 +0000
- Revision:
- 4:d69d779e204b
- Parent:
- 3:8587d08d9f65
While Task 3
Who changed what in which revision?
User | Revision | Line number | New 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 | 0:363abd3fc535 | 11 | int main() |
Dominik32 | 0:363abd3fc535 | 12 | { |
Dominik32 | 4:d69d779e204b | 13 | Alle_Befehle karel; |
Dominik32 | 4:d69d779e204b | 14 | int x =0; |
Dominik32 | 4:d69d779e204b | 15 | |
Dominik32 | 0:363abd3fc535 | 16 | |
Dominik32 | 2:0e1b409ff333 | 17 | while(1) |
Dominik32 | 0:363abd3fc535 | 18 | { |
Dominik32 | 4:d69d779e204b | 19 | |
Dominik32 | 4:d69d779e204b | 20 | while(!karel.NextToABeeper() && karel.FrontIsClear()) |
Dominik32 | 4:d69d779e204b | 21 | { |
Dominik32 | 4:d69d779e204b | 22 | karel.Move(); |
Dominik32 | 1:5bcd7fd92f60 | 23 | } |
Dominik32 | 4:d69d779e204b | 24 | |
Dominik32 | 2:0e1b409ff333 | 25 | karel.TurnLeft(); |
Dominik32 | 3:8587d08d9f65 | 26 | |
Dominik32 | 4:d69d779e204b | 27 | while(karel.NextToABeeper() && karel.FrontIsClear()) |
Dominik32 | 3:8587d08d9f65 | 28 | { |
Dominik32 | 4:d69d779e204b | 29 | karel.PickBeeper(); |
Dominik32 | 4:d69d779e204b | 30 | karel.Move(); |
Dominik32 | 4:d69d779e204b | 31 | x++; |
Dominik32 | 3:8587d08d9f65 | 32 | } |
Dominik32 | 2:0e1b409ff333 | 33 | |
Dominik32 | 4:d69d779e204b | 34 | karel.TurnAround(); |
Dominik32 | 4:d69d779e204b | 35 | |
Dominik32 | 4:d69d779e204b | 36 | while(x>0) |
Dominik32 | 4:d69d779e204b | 37 | { |
Dominik32 | 4:d69d779e204b | 38 | karel.Move(); |
Dominik32 | 4:d69d779e204b | 39 | x--; |
Dominik32 | 4:d69d779e204b | 40 | } |
Dominik32 | 4:d69d779e204b | 41 | karel.TurnLeft(); |
Dominik32 | 4:d69d779e204b | 42 | karel.Move(); |
Dominik32 | 4:d69d779e204b | 43 | |
Dominik32 | 2:0e1b409ff333 | 44 | } |
Dominik32 | 4:d69d779e204b | 45 | |
Dominik32 | 4:d69d779e204b | 46 | |
Dominik32 | 4:d69d779e204b | 47 | |
Dominik32 | 4:d69d779e204b | 48 | |
Dominik32 | 2:0e1b409ff333 | 49 | |
Dominik32 | 2:0e1b409ff333 | 50 | } |
Dominik32 | 0:363abd3fc535 | 51 |