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.
Dependencies: mbed SDFileSystem
Button_Interrupt.cpp
00001 00002 #ifdef COMPILE_Button_Interrupt 00003 00004 00005 InterruptIn button(USER_BUTTON); 00006 00007 DigitalOut led(LED1); 00008 00009 double delay = 0.5; // 500 ms 00010 00011 void pressed() 00012 { 00013 delay = 0.1; // 100 ms 00014 } 00015 00016 void released() 00017 { 00018 delay = 0.5; // 500 ms 00019 } 00020 00021 int main() 00022 { 00023 // Assign functions to button 00024 button.fall(&pressed); 00025 button.rise(&released); 00026 00027 while (1) { 00028 led = !led; 00029 wait(delay); 00030 } 00031 } 00032 00033 #endif
Generated on Fri Jul 15 2022 04:49:55 by
1.7.2