пеас

Dependencies:   mbed

Revision:
0:beb25340afe3
diff -r 000000000000 -r beb25340afe3 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Dec 09 17:40:59 2014 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+
+Serial pc(USBTX, USBRX);  // USBTX - Tranmit on USB  USBRX - receive on USB
+
+int main()
+{
+    char read[10];
+   
+    while(1)
+    {  
+        wait(1);
+        printf("Heartbeat \r");
+              
+        if ( pc.readable() )
+        {     
+            printf("  There's something to read\r");
+            pc.scanf("%s", &read);
+            printf("  Reading %s \r", read);
+        }        
+    }
+}
\ No newline at end of file