Hello World for InterruptIn

Fork of InterruptIn_HelloWorld by Mbed

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

No documentation found.

Files at this revision

API Documentation at this revision

Comitter:
mab5449
Date:
Thu Jan 19 10:41:34 2017 -0600
Parent:
2:dc8472f90484
Child:
4:de061b559d35
Commit message:
Ported mbed OS 2 to mbed OS 5

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show diff for this revision Revisions of this file
--- 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);
  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Thu Jan 19 10:41:34 2017 -0600
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#04a31f3b39bfbd69e155ed7c9f55880fd75278ba
--- a/mbed.bld	Fri Mar 27 20:14:27 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/487b796308b0
\ No newline at end of file