Test program for serial interface

This program turns the red LED on and then waits for a character to be entered at the terminal. The LED then goes off for 500ms before the cycle repeats.

The purpose of the program is to demonstrate the use of the serial link

Revision:
0:75835b5692b9
Child:
1:961580c296da
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jan 16 22:05:16 2017 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+#include "rtos.h"
+
+DigitalOut myled(LED1);
+Serial pc(USBTX, USBRX); // tx, rx
+
+int main() {
+    char c ;
+    pc.printf("Enter a character>");
+    while(1) {
+        myled = 0;  // turn on
+        c = pc.getc();
+        myled = 1;  // turn off
+        pc.putc(c);
+        pc.putc('\n');
+        Thread::wait(500);
+        pc.printf("Enter a character>");
+    }
+}