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
- Committer:
- homayoun
- Date:
- 2014-09-03
- Revision:
- 1:a219c25967db
- Parent:
- 0:7a20a6aa1f5e
File content as of revision 1:a219c25967db:
#include "mbed.h" InterruptIn button(USER_BUTTON); DigitalOut led(LED1); void buttonPressed() { led = 1; } void buttonReleased() { led = 0; } void setup() { // button.mode(PullUp); button.rise(&buttonReleased); // attach the address of the buttonReleased function to the rising edge button.fall(&buttonPressed); // attach the address of the buttonPressed function to the falling edge } void loop() { // put your main code here, to run repeatedly: } int main() { setup(); while(1) loop(); }