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:e67b3d8994f1
diff -r 000000000000 -r e67b3d8994f1 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Sep 26 14:50:55 2018 +0000
@@ -0,0 +1,27 @@
+#include "mbed.h"              
+ 
+Serial pc(USBTX, USBRX);
+DigitalOut    led (LED1);
+
+char cmd[100];
+
+int main() {
+    //pc.baud(19200);
+    pc.baud(921600);
+    //pc.printf("Echoes back to the screen anything you type\n");
+    while(1) {
+        if (pc.readable()>0)
+        {
+            led = 1;
+            pc.scanf("%s",cmd);
+            //pc.putc(pc.getc());
+            led = 0;
+            pc.printf(cmd);
+        }
+        else
+        {
+            //led = !led;
+            wait(0.2);
+        }
+    }
+}