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.
Diff: main.cpp
- Revision:
- 1:fb796ffb9602
- Parent:
- 0:6e4883610cb2
diff -r 6e4883610cb2 -r fb796ffb9602 main.cpp
--- a/main.cpp Thu Mar 31 10:34:58 2022 +0000
+++ b/main.cpp Thu Mar 31 10:40:37 2022 +0000
@@ -1,24 +1,23 @@
#include "mbed.h"
InterruptIn button(USER_BUTTON);
-
-DigitalOut led(LED1);
+DigitalOut led(LED1);
+Serial link(SERIAL_TX, SERIAL_RX);
double delay = 0.5; // 500 ms
void pressed()
{
- delay = 0.1; // 100 ms
+ link.printf("Button pressed!\r\n");
}
void released()
{
- delay = 0.5; // 500 ms
+ link.printf("Button released!\r\n");
}
int main()
{
- // Assign functions to button
button.fall(&pressed);
button.rise(&released);