M Seiser
/
WHILE_TASK1
LEDs gehen an wenn Taster gedrückt
Diff: main.cpp
- Revision:
- 0:bb5edc977ef2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Apr 24 08:42:20 2015 +0000 @@ -0,0 +1,32 @@ +#include "mbed.h" +#include "ur_Bertl.h" +#include "const.h" + + + + +int main() +{ + + ur_Bertl karel; + + while(1) + { + if(karel.IsButtonPressed(BTN_FLL)) //linker Button vorne außen + karel.TurnLedOn(0x01); + if(karel.IsButtonPressed(BTN_FRR)) //rechter Button vorne außen + karel.TurnLedOn(0x04); + if(karel.IsButtonPressed(BTN_FRR)&&karel.IsButtonPressed(BTN_FLL)) + karel.TurnLedOn(0x0F); + if(karel.IsButtonPressed(BTN_BR)) //linker Button hinten außen + karel.TurnLedOn(0x80); + if(karel.IsButtonPressed(BTN_BL)) //rechter Button hinten außen + karel.TurnLedOn(0x20); + if(karel.IsButtonPressed(BTN_BR)&&(karel.IsButtonPressed(BTN_BL))) + karel.TurnLedOn(0xF0); + } + + +} + +