doppler shift / Mbed 2 deprecated aaa

Dependencies:   mbed

Committer:
KINU
Date:
Wed Dec 09 14:37:41 2020 +0000
Revision:
1:03cb3b25065c
Parent:
0:303ad425d2ac
ss

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ryouheitakamoto 0:303ad425d2ac 1 #include "mbed.h"
KINU 1:03cb3b25065c 2 #include "stdio.h"
KINU 1:03cb3b25065c 3 #include "stdlib.h"
KINU 1:03cb3b25065c 4 #include "time.h"
KINU 1:03cb3b25065c 5
ryouheitakamoto 0:303ad425d2ac 6
KINU 1:03cb3b25065c 7 Serial pc(SERIAL_TX, SERIAL_RX);
KINU 1:03cb3b25065c 8 Serial device(PA_9,PA_10);
KINU 1:03cb3b25065c 9 //Serial dir(PA_10);
KINU 1:03cb3b25065c 10 int main(){
KINU 1:03cb3b25065c 11
KINU 1:03cb3b25065c 12 char c;
KINU 1:03cb3b25065c 13 //clock_t start = clock();
KINU 1:03cb3b25065c 14
KINU 1:03cb3b25065c 15 while(9600) {
KINU 1:03cb3b25065c 16 c = device.getc();
KINU 1:03cb3b25065c 17 if(c - '0')
ryouheitakamoto 0:303ad425d2ac 18 {
ryouheitakamoto 0:303ad425d2ac 19 pc.printf("1\r\n");
ryouheitakamoto 0:303ad425d2ac 20 }
ryouheitakamoto 0:303ad425d2ac 21 else
ryouheitakamoto 0:303ad425d2ac 22 {
ryouheitakamoto 0:303ad425d2ac 23 pc.printf("0\r\n");
ryouheitakamoto 0:303ad425d2ac 24 }
KINU 1:03cb3b25065c 25 }
KINU 1:03cb3b25065c 26 /*
KINU 1:03cb3b25065c 27 clock_t end = clock();
KINU 1:03cb3b25065c 28 const double time = static_cast<double>(end-start) / CLOCKS_PER_SEC;
KINU 1:03cb3b25065c 29 printf("time %lf[s]\n",time);
KINU 1:03cb3b25065c 30 */
KINU 1:03cb3b25065c 31 return 0;
ryouheitakamoto 0:303ad425d2ac 32
ryouheitakamoto 0:303ad425d2ac 33 }