![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Wenn ein bestimmter Taster gedrückt wird, leuchtet die dazugehörige Led :)
main.cpp
- Committer:
- martinale
- Date:
- 2015-04-24
- Revision:
- 1:c837c1d0e805
- Parent:
- 0:c3e0cd3c6140
File content as of revision 1:c837c1d0e805:
#include "mbed.h" #include "Robot.h" #include "const.h" int main() { Robot karel; karel.TurnLedOff(LED_ALL); while(1) { if(karel.IsButtonPressed(BTN_FLL)) karel.TurnLedOn(0x01); if(karel.IsButtonPressed(BTN_FRR)) karel.TurnLedOn(0x04); if(karel.IsButtonPressed(BTN_BL)) karel.TurnLedOn(0x20); if(karel.IsButtonPressed(BTN_BR)) karel.TurnLedOn(0x80); else karel.TurnLedOn(0x00); } }