![](/media/cache/profiles/Johan.jpg.50x50_q85.jpg)
This example shows how to use interruptions to simply turn on/off a led.
Fork of mbed-os-example-mbed5-blinky by
main.cpp
- Committer:
- jsquiroga
- Date:
- 2018-03-26
- Revision:
- 64:e5a8e29c82de
- Parent:
- 30:0b58d21e87d6
File content as of revision 64:e5a8e29c82de:
#include "mbed.h" //Define outputs DigitalOut blue(LED3); //Define interrupt inputs InterruptIn button(SW2); //interrupcion para el boton 2 void BlinkLed (){ blue=!blue; } int main() { __enable_irq(); //Enable Interrupts blue=0; //initialize output button.rise(&BlinkLed); //The ISR activates with rising edge of button and activate the function. while(1) { // Write your code } }