Sushil Deka
/
SW
mBed switch for LED
Revision 0:9e5ce93b7aa3, committed 2014-02-18
- Comitter:
- skdeka
- Date:
- Tue Feb 18 12:30:30 2014 +0000
- Commit message:
- mbed Swicth for LED
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 9e5ce93b7aa3 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Feb 18 12:30:30 2014 +0000 @@ -0,0 +1,17 @@ +#include "mbed.h" + +DigitalOut myled(LED1); +InterruptIn SW(p21); + +void Switch_trigger(void) +{ + myled = !myled; +} + +int main() { + SW.mode(PullUp); + + while(1) { + SW.rise(&Switch_trigger); + } +}
diff -r 000000000000 -r 9e5ce93b7aa3 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Feb 18 12:30:30 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file