STDin and STDout example

Dependencies:   mbed

Revision:
0:8c4e69ec8e4d
Child:
1:2f9d56e97f30
diff -r 000000000000 -r 8c4e69ec8e4d main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 08 13:56:07 2018 +0000
@@ -0,0 +1,15 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+Serial pc(USBTX, USBRX);
+
+int main() {
+    char buffer[128];
+
+    pc.printf("Starting..\n");
+
+    while (1) {
+        pc.gets(buffer, 4);
+        pc.printf("I got '%s'\n", buffer);
+    }
+}