Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 /* Program Example 9.1: Simple interrupt example. External input causes interrupt, while led flashes 00002 */ 00003 #include "mbed.h" 00004 InterruptIn button(p5); //define and name the interrupt input 00005 DigitalOut led(LED1); 00006 DigitalOut flash(LED4); 00007 00008 void ISR1() { //this is the response to interrupt, i.e. the ISR 00009 led = !led; 00010 } 00011 00012 int main() { 00013 button.rise(&ISR1); // attach the address of the ISR function to the 00014 // interrupt rising edge 00015 while(1) { // continuous loop, ready to be interrupted 00016 flash = !flash; 00017 wait(0.25); 00018 } 00019 } 00020
Generated on Tue Aug 16 2022 12:20:46 by
1.7.2