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:
- 0:573c02b712fe
- Child:
- 2:ba7945a8d1c6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Apr 21 19:36:21 2017 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+
+Ticker toggle_led_ticker;
+
+DigitalOut led1(LED1);
+
+void toggle_led() {
+ led1 = !led1;
+}
+
+int main() {
+ // Init the ticker with the address of the function (toggle_led) to be attached and the interval (100 ms)
+ toggle_led_ticker.attach(&toggle_led, 0.1);
+ while (true) {
+ // Do other things...
+ }
+}
\ No newline at end of file