doppler shift / Mbed 2 deprecated aaa

Dependencies:   mbed

Revision:
1:03cb3b25065c
Parent:
0:303ad425d2ac
--- a/main.cpp	Mon Dec 07 11:01:49 2020 +0000
+++ b/main.cpp	Wed Dec 09 14:37:41 2020 +0000
@@ -1,14 +1,20 @@
 #include "mbed.h"
-Serial pc(SERIAL_TX, SERIAL_RX);
-//Serial device(PA_9,PA_10);
+#include "stdio.h"
+#include "stdlib.h"
+#include "time.h"
+
 
-DigitalIn dir(PA_10);
- 
-int main()
-{
-    while(1) {
-        
-    if(dir)
+Serial pc(SERIAL_TX, SERIAL_RX);
+Serial device(PA_9,PA_10);
+//Serial dir(PA_10);
+int main(){
+
+    char c;    
+    //clock_t start = clock();
+     
+    while(9600) {
+        c = device.getc();
+    if(c - '0')
     {
       pc.printf("1\r\n");  
     }
@@ -16,6 +22,12 @@
     {
       pc.printf("0\r\n"); 
     }
+    }
+    /*
+    clock_t end = clock();
+    const double time = static_cast<double>(end-start) / CLOCKS_PER_SEC;
+    printf("time %lf[s]\n",time);
+    */
+    return 0;
     
-    }
 }
\ No newline at end of file