Button Press on Vibro Model
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:7b26ada49c8f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Nov 05 00:44:17 2014 +0000 @@ -0,0 +1,25 @@ +#include "mbed.h" + +DigitalOut ledB(LED1); +InterruptIn button1(p15); + +void lighton() +{ + ledB = 0; +} +void lightoff() +{ + ledB = 1; +} + +int main() +{ + ledB = 1; + button1.mode(PullUp); + button1.fall(&lighton); + button1.rise(&lightoff); + while(1) + { + + } +}