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
- Committer:
- szuckerman
- Date:
- 2022-03-31
- Revision:
- 1:fb796ffb9602
- Parent:
- 0:6e4883610cb2
File content as of revision 1:fb796ffb9602:
#include "mbed.h"
InterruptIn button(USER_BUTTON);
DigitalOut led(LED1);
Serial link(SERIAL_TX, SERIAL_RX);
double delay = 0.5; // 500 ms
void pressed()
{
link.printf("Button pressed!\r\n");
}
void released()
{
link.printf("Button released!\r\n");
}
int main()
{
button.fall(&pressed);
button.rise(&released);
while (1) {
led = !led;
wait(delay);
}
}