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
Fork of Amaldi_4_Exercise_LED-Button_Interrupt by
main.cpp
- Committer:
- bcostm
- Date:
- 2017-07-06
- Revision:
- 0:7d38be0bc9c1
File content as of revision 0:7d38be0bc9c1:
#include "mbed.h"
InterruptIn button(USER_BUTTON);
DigitalOut led(LED1);
double delay = 0.5; // 500 ms
void pressed()
{
delay = 0.1; // 100 ms
}
void released()
{
delay = 0.5; // 500 ms
}
int main()
{
// Assign functions to button
button.fall(&pressed);
button.rise(&released);
while (1) {
led = !led;
wait(delay);
}
}
