![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Enciende led1 y led2 por interrupciones en los pines de entrada
Revision 0:0d7118880416, committed 2017-04-26
- Comitter:
- franni
- Date:
- Wed Apr 26 23:22:05 2017 +0000
- Commit message:
- Interrupciones
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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Apr 26 23:22:05 2017 +0000 @@ -0,0 +1,34 @@ +#include "mbed.h" + +DigitalOut led1(LED1); +DigitalOut led2(LED2); + +InterruptIn int1(PTD6); +InterruptIn int2(PTD7); + +void ISR_Pin6() +{ + + led1 = !led1; + wait(1); + +} + +void ISR_Pin7() +{ + + led2 = !led2; + wait(1); + +} + +int main() +{ + int1.mode(PullUp); + int2.mode(PullUp); + int1.rise(&ISR_Pin6); + int2.fall(&ISR_Pin7); + + + while(1) {} +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Apr 26 23:22:05 2017 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/97feb9bacc10 \ No newline at end of file