You can write text with this programm.

Dependencies:   MODSERIAL mbed

Fork of Minor_test_serial by First Last

Revision:
1:26ce7013f2c5
Parent:
0:c8f15874531b
Child:
2:4ffe049e7231
--- a/main.cpp	Wed Sep 02 14:50:46 2015 +0000
+++ b/main.cpp	Mon Sep 12 10:14:01 2016 +0000
@@ -3,6 +3,7 @@
 
 DigitalOut myled(LED_GREEN);
 MODSERIAL pc(USBTX, USBRX);
+char c;
 
 int main()
 {
@@ -10,10 +11,13 @@
     pc.baud(115200);
     pc.printf("Hello World!\n");
     
-    while (true) {
-        wait(0.5f); // wait a small period of time
-        pc.printf("%d \n", i); // print the value of variable i
+    while(true){
+    {
+        c = pc.getc();
+        pc.printf("%c", c); // print the value of variable i
         i++; // increment the variable
         myled = !myled; // toggle a led
+        wait(0.1f);
+    }
     }
 }