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.2: Tests interrupt latency. External input causes interrupt, which pulses external LED while LED4 flashes continuously. 00002 */ 00003 #include "mbed.h" 00004 InterruptIn squarewave(p5); //Connect input square wave here 00005 DigitalOut led(p6); 00006 DigitalOut flash(LED4); 00007 00008 void pulse() { //ISR sets external led high for fixed duration 00009 led = 1; 00010 wait(0.01); 00011 led = 0; 00012 } 00013 00014 int main() { 00015 squarewave.rise(&pulse); // attach the address of the pulse function to 00016 // the rising edge 00017 while(1) { // interrupt will occur within this endless loop 00018 flash = !flash; 00019 wait(0.25); 00020 } 00021 } 00022
Generated on Thu Aug 4 2022 22:15:48 by
1.7.2