Dependencies:   mbed

Fork of mDot_helloworld by MultiTech

Revision:
0:fdc94d24e54a
Child:
1:34c1fcb8ea5a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jun 10 16:56:38 2015 +0000
@@ -0,0 +1,26 @@
+/*************************************
+ * This simple example program blinks
+ * LED1 and prints a message out the
+ * USB debug port.
+ ************************************/
+
+#include "mbed.h"
+
+DigitalOut led(LED1);
+Ticker tick;
+
+// callback function to change LED state
+void blink() {
+    led = !led;
+}
+
+int main() {
+    // configure the Ticker to blink the LED on 500ms interval
+    tick.attach(&blink, 0.5);
+    
+    // print the message on 2s interval
+    while (true) {
+        printf("Hello world!\r\n");
+        wait(2);
+    }
+}
\ No newline at end of file