Roberto Vázquez
/
frdm_excercise7
ejercicio 7 de interrupciones
Revision 0:2190998da98e, committed 2014-09-25
- Comitter:
- rvazquezc
- Date:
- Thu Sep 25 19:00:22 2014 +0000
- Commit message:
- ejercicio 7
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 Thu Sep 25 19:00:22 2014 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" +#define on 0 +#define off 1 +DigitalOut azul(LED_BLUE); +DigitalOut rojo(LED_RED); +InterruptIn sw2(SW2); +DigitalOut verde(LED_GREEN); +void task(void); +int main() +{azul=on; +rojo=off; + while (true) { + azul=!azul; + rojo=!rojo; + wait (1.0f); + sw2.rise(&task); + } +} +void task() +{verde=on; +wait (5.0f); + } \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Sep 25 19:00:22 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1 \ No newline at end of file