Switch on and off LED1 by using a pushbutton. The program implements a very simple Finite State Machine.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 1:aa56bae2dac7
- Parent:
- 0:f64b05ad6b04
--- a/main.cpp Sun Jan 24 13:44:23 2016 +0000 +++ b/main.cpp Thu Jan 28 15:21:39 2016 +0000 @@ -31,10 +31,10 @@ } break; case STATE_WAIT_FOR_RELEASE: - if (SW1==1) { //if button released + if (SW1==1) { //if button released mystate = STATE_WAIT_FOR_PRESS; } } - wait_ms(20); //debounce delay + wait_ms(20); //debounce delay } } \ No newline at end of file