Jose Rios / Mbed 2 deprecated Nucleo_Serial

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
jose_23991
Date:
Mon Sep 08 17:44:45 2014 +0000
Commit message:
Version 1.0

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r e0af24384f80 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Sep 08 17:44:45 2014 +0000
@@ -0,0 +1,30 @@
+////////////////////////////////////////
+// Hyperterminal configuration        //
+// 9600 bauds, 8-bit data, no parity  //
+////////////////////////////////////////
+
+#include "mbed.h"
+
+Serial serial(SERIAL_TX, SERIAL_RX);
+DigitalOut myled(LED1);
+ 
+int main()
+{
+    int i = 1;
+      
+    /* Print the serial header */
+    serial.printf("\n");
+    serial.printf("\n------------------------------------------------------");
+    serial.printf("\n--                     SERIAL                       --");
+    serial.printf("\n------------------------------------------------------");
+    serial.printf("\nHello World !");
+    serial.printf("\n");
+          
+    while(1)
+    { 
+        wait(1);                                                     // Wait 1s
+        serial.printf("\n This program runs since %d seconds", i);   // Show the counter (seconds)
+        myled = !myled;                                              // Toggle the LED state
+        i++;                                                         // Increase the counter (seconds)
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r e0af24384f80 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Sep 08 17:44:45 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013
\ No newline at end of file