Martin Werluschnig
/
BertlDrive_V2
BertlDrive_V2
main.cpp@1:ca7fdf2e285d, 2015-04-16 (annotated)
- Committer:
- bulmecisco
- Date:
- Thu Apr 16 11:44:31 2015 +0000
- Revision:
- 1:ca7fdf2e285d
- Parent:
- 0:6d28be2dcb7c
- Child:
- 2:1115b3fa7fde
Test AnyBeeperInBag
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DoTTi | 0:6d28be2dcb7c | 1 | #include "mbed.h" |
DoTTi | 0:6d28be2dcb7c | 2 | #include "const.h" |
DoTTi | 0:6d28be2dcb7c | 3 | #include "ur_Bertl.h" |
DoTTi | 0:6d28be2dcb7c | 4 | |
DoTTi | 0:6d28be2dcb7c | 5 | int main() |
DoTTi | 0:6d28be2dcb7c | 6 | { |
bulmecisco | 1:ca7fdf2e285d | 7 | |
DoTTi | 0:6d28be2dcb7c | 8 | ur_Bertl karel; |
DoTTi | 0:6d28be2dcb7c | 9 | |
bulmecisco | 1:ca7fdf2e285d | 10 | while(karel.AnyBeeperInBag()) |
bulmecisco | 1:ca7fdf2e285d | 11 | { |
bulmecisco | 1:ca7fdf2e285d | 12 | } |
DoTTi | 0:6d28be2dcb7c | 13 | karel.TurnLedOff(LED_ALL); |
DoTTi | 0:6d28be2dcb7c | 14 | while(1) |
DoTTi | 0:6d28be2dcb7c | 15 | { |
DoTTi | 0:6d28be2dcb7c | 16 | if( karel.IsButtonPressed(BTN_FLL)) |
DoTTi | 0:6d28be2dcb7c | 17 | karel.NibbleLeds(0x01); |
DoTTi | 0:6d28be2dcb7c | 18 | |
DoTTi | 0:6d28be2dcb7c | 19 | if( karel.IsButtonPressed(BTN_FL)) |
DoTTi | 0:6d28be2dcb7c | 20 | karel.NibbleLeds(0x02); |
DoTTi | 0:6d28be2dcb7c | 21 | |
DoTTi | 0:6d28be2dcb7c | 22 | if( karel.IsButtonPressed(BTN_FM)) |
DoTTi | 0:6d28be2dcb7c | 23 | karel.NibbleLeds(0x0F); |
DoTTi | 0:6d28be2dcb7c | 24 | |
DoTTi | 0:6d28be2dcb7c | 25 | if( karel.IsButtonPressed(BTN_FR)) |
DoTTi | 0:6d28be2dcb7c | 26 | karel.NibbleLeds(0x04); |
DoTTi | 0:6d28be2dcb7c | 27 | |
DoTTi | 0:6d28be2dcb7c | 28 | if( karel.IsButtonPressed(BTN_FRR)) |
DoTTi | 0:6d28be2dcb7c | 29 | karel.NibbleLeds(0x08); |
DoTTi | 0:6d28be2dcb7c | 30 | |
DoTTi | 0:6d28be2dcb7c | 31 | if( karel.IsButtonPressed(BTN_BL)) |
DoTTi | 0:6d28be2dcb7c | 32 | karel.NibbleLeds(0x0E); |
DoTTi | 0:6d28be2dcb7c | 33 | |
DoTTi | 0:6d28be2dcb7c | 34 | if( karel.IsButtonPressed(BTN_BM)) |
DoTTi | 0:6d28be2dcb7c | 35 | karel.NibbleLeds(0x09); |
DoTTi | 0:6d28be2dcb7c | 36 | |
DoTTi | 0:6d28be2dcb7c | 37 | if( karel.IsButtonPressed(BTN_BR)) |
DoTTi | 0:6d28be2dcb7c | 38 | karel.NibbleLeds(0x07); |
DoTTi | 0:6d28be2dcb7c | 39 | |
DoTTi | 0:6d28be2dcb7c | 40 | else |
DoTTi | 0:6d28be2dcb7c | 41 | karel.NibbleLeds(0x00); |
DoTTi | 0:6d28be2dcb7c | 42 | |
DoTTi | 0:6d28be2dcb7c | 43 | } |
DoTTi | 0:6d28be2dcb7c | 44 | } |