![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Wenn ein bestimmter Taster gedrückt wird, leuchtet die dazugehörige Led :)
main.cpp@1:c837c1d0e805, 2015-04-24 (annotated)
- Committer:
- martinale
- Date:
- Fri Apr 24 08:50:41 2015 +0000
- Revision:
- 1:c837c1d0e805
- Parent:
- 0:c3e0cd3c6140
Beim ersten While_Task1, gro?/klein Schreibfehler :((
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
martinale | 0:c3e0cd3c6140 | 1 | #include "mbed.h" |
martinale | 0:c3e0cd3c6140 | 2 | #include "Robot.h" |
martinale | 0:c3e0cd3c6140 | 3 | #include "const.h" |
martinale | 0:c3e0cd3c6140 | 4 | |
martinale | 0:c3e0cd3c6140 | 5 | int main() |
martinale | 0:c3e0cd3c6140 | 6 | { |
martinale | 0:c3e0cd3c6140 | 7 | Robot karel; |
martinale | 0:c3e0cd3c6140 | 8 | |
martinale | 1:c837c1d0e805 | 9 | karel.TurnLedOff(LED_ALL); |
martinale | 0:c3e0cd3c6140 | 10 | |
martinale | 0:c3e0cd3c6140 | 11 | while(1) { |
martinale | 0:c3e0cd3c6140 | 12 | if(karel.IsButtonPressed(BTN_FLL)) |
martinale | 0:c3e0cd3c6140 | 13 | karel.TurnLedOn(0x01); |
martinale | 0:c3e0cd3c6140 | 14 | |
martinale | 0:c3e0cd3c6140 | 15 | if(karel.IsButtonPressed(BTN_FRR)) |
martinale | 0:c3e0cd3c6140 | 16 | karel.TurnLedOn(0x04); |
martinale | 0:c3e0cd3c6140 | 17 | |
martinale | 0:c3e0cd3c6140 | 18 | if(karel.IsButtonPressed(BTN_BL)) |
martinale | 0:c3e0cd3c6140 | 19 | karel.TurnLedOn(0x20); |
martinale | 0:c3e0cd3c6140 | 20 | |
martinale | 0:c3e0cd3c6140 | 21 | if(karel.IsButtonPressed(BTN_BR)) |
martinale | 0:c3e0cd3c6140 | 22 | karel.TurnLedOn(0x80); |
martinale | 0:c3e0cd3c6140 | 23 | |
martinale | 0:c3e0cd3c6140 | 24 | else |
martinale | 0:c3e0cd3c6140 | 25 | karel.TurnLedOn(0x00); |
martinale | 0:c3e0cd3c6140 | 26 | |
martinale | 0:c3e0cd3c6140 | 27 | } |
martinale | 0:c3e0cd3c6140 | 28 | } |