Niclas Esterl
/
LEDTestmitButton
Button pressed == Led on
Diff: main.cpp
- Revision:
- 0:b3c21f1e4ba0
diff -r 000000000000 -r b3c21f1e4ba0 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Nov 30 14:22:07 2015 +0000 @@ -0,0 +1,60 @@ +#include "mbed.h" +#include "const.h" +#include "Robot.h" +Robot bertl; + +int main() +{ + + while(1) + { + if (bertl.IsButtonPressed(BTN_BL)) + { + bertl.TurnLedOn(LED_BL1); + bertl.TurnLedOn(LED_BL2); + } + + + if (bertl.IsButtonPressed(BTN_BR)) + { + bertl.TurnLedOn(LED_BR1); + bertl.TurnLedOn(LED_BR2); + } + + + if (bertl.IsButtonPressed(BTN_FLL)) + { + bertl.TurnLedOn(LED_FL1); + + } + + if (bertl.IsButtonPressed(BTN_FL)) + { + + bertl.TurnLedOn(LED_FL2); + } + + if (bertl.IsButtonPressed(BTN_FRR)) + { + bertl.TurnLedOn(LED_FR1); + + } + + + if (bertl.IsButtonPressed(BTN_FR)) + { + + bertl.TurnLedOn(LED_FR2); + } + + + if (bertl.IsButtonPressed(BTN_BM) ) + { + bertl.TurnLedOff(LED_ALL); + } + + } + + + + } \ No newline at end of file