Hello World for InterruptIn
Fork of InterruptIn_HelloWorld by
Use
Interrupts are a way of causing a function to be called when a certain event happens. This example demonstrates calling a function when a button is pressed. Specifically on the rising edge of a button press. This can be observed by LED4 blinking as the program runs and LED1 only changing when the button is pressed.
API
API reference.
Import librarymbed
Diff: main.cpp
- Revision:
- 3:f729f0421740
- Parent:
- 2:dc8472f90484
--- a/main.cpp Fri Mar 27 20:14:27 2015 +0000 +++ b/main.cpp Thu Jan 19 10:41:34 2017 -0600 @@ -15,7 +15,7 @@ */ #include "mbed.h" -InterruptIn button(p5); +InterruptIn button(SW2); DigitalOut led(LED1); DigitalOut flash(LED4);