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.
Fork of InterruptIn_HelloWorld by
main.cpp
00001 #include "mbed.h" 00002 00003 InterruptIn button(USER_BUTTON); 00004 DigitalOut led(LED1); 00005 00006 void buttonPressed() 00007 { 00008 led = 1; 00009 } 00010 00011 void buttonReleased() 00012 { 00013 led = 0; 00014 } 00015 00016 void setup() 00017 { 00018 // button.mode(PullUp); 00019 button.rise(&buttonReleased); // attach the address of the buttonReleased function to the rising edge 00020 button.fall(&buttonPressed); // attach the address of the buttonPressed function to the falling edge 00021 } 00022 00023 void loop() 00024 { 00025 // put your main code here, to run repeatedly: 00026 00027 } 00028 00029 int main() 00030 { 00031 setup(); 00032 while(1) loop(); 00033 }
Generated on Mon Jul 18 2022 14:03:45 by
1.7.2
