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 Nucleo-mbed-os-example-blinky by
Diff: main.cpp
- Revision:
- 0:681c27ac21c0
- Child:
- 1:860c7462805e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Aug 17 17:58:13 2016 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+
+
+DigitalOut led1(LED1);
+InterruptIn event(USER_BUTTON);
+Ticker ticker;
+
+void
+ButtonPressed(void)
+{
+ led1 = !led1;
+}
+
+void
+AlarmHandler(void)
+{
+ led1 = !led1;
+}
+
+int main()
+{
+ event.rise(&ButtonPressed);
+ ticker.attach(&AlarmHandler, 1.5);
+
+ while (true) {
+ ;
+ }
+}
