Dominik Weiss
/
Liniensensor_2
Versuch 2
main.cpp@3:8587d08d9f65, 2015-04-24 (annotated)
- Committer:
- Dominik32
- Date:
- Fri Apr 24 07:46:09 2015 +0000
- Revision:
- 3:8587d08d9f65
- Parent:
- 2:0e1b409ff333
Liniensensor Versuch 2;
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 | 1:5bcd7fd92f60 | 13 | ur_Bertl karel; |
Dominik32 | 3:8587d08d9f65 | 14 | int x = 0; |
Dominik32 | 0:363abd3fc535 | 15 | |
Dominik32 | 2:0e1b409ff333 | 16 | while(1) |
Dominik32 | 0:363abd3fc535 | 17 | { |
Dominik32 | 2:0e1b409ff333 | 18 | while(karel.NextToABeeper()) |
Dominik32 | 2:0e1b409ff333 | 19 | { |
Dominik32 | 2:0e1b409ff333 | 20 | karel.Move(); |
Dominik32 | 1:5bcd7fd92f60 | 21 | } |
Dominik32 | 2:0e1b409ff333 | 22 | karel.MoveBackwards(); |
Dominik32 | 2:0e1b409ff333 | 23 | karel.TurnLeft(); |
Dominik32 | 3:8587d08d9f65 | 24 | x = x++; |
Dominik32 | 3:8587d08d9f65 | 25 | |
Dominik32 | 3:8587d08d9f65 | 26 | if ( x % 2 == 0) |
Dominik32 | 3:8587d08d9f65 | 27 | { |
Dominik32 | 3:8587d08d9f65 | 28 | karel.TurnLeft(); //Damit er nicht zurückfährt |
Dominik32 | 3:8587d08d9f65 | 29 | } |
Dominik32 | 2:0e1b409ff333 | 30 | |
Dominik32 | 2:0e1b409ff333 | 31 | } |
Dominik32 | 2:0e1b409ff333 | 32 | |
Dominik32 | 2:0e1b409ff333 | 33 | } |
Dominik32 | 0:363abd3fc535 | 34 |