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 #include "mbed.h" 00002 //example using InterruptIn with the input from the PIR motion sensors 00003 InterruptIn alarm(p11); 00004 DigitalOut led(LED1); 00005 DigitalOut flash(LED4); 00006 00007 void flip() { 00008 led = !led; 00009 } 00010 00011 int main() { 00012 alarm.mode(PullUp); 00013 wait(2); 00014 alarm.fall(&flip); // attach the address of the flip function to the falling edge 00015 while(1) { // wait around, interrupts will interrupt 00016 flash = !flash; 00017 wait(0.25); 00018 } 00019 }
Generated on Wed Jul 13 2022 08:27:24 by
1.7.2