doppler shift / Mbed 2 deprecated calsat32_3

Dependencies:   mbed

Committer:
ryouheitakamoto
Date:
Fri Dec 11 08:56:41 2020 +0000
Revision:
1:fec69401b978
Parent:
0:c5c02975ae0c
Child:
2:43801dc371d0
yes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ryouheitakamoto 0:c5c02975ae0c 1 #include "mbed.h"
ryouheitakamoto 0:c5c02975ae0c 2
ryouheitakamoto 0:c5c02975ae0c 3 Serial pc(SERIAL_TX, SERIAL_RX);
ryouheitakamoto 0:c5c02975ae0c 4 Serial device(PA_9,PA_10);
ryouheitakamoto 0:c5c02975ae0c 5
ryouheitakamoto 0:c5c02975ae0c 6 void doppler(){
ryouheitakamoto 0:c5c02975ae0c 7 while(1){
ryouheitakamoto 0:c5c02975ae0c 8 char c = device.getc();
ryouheitakamoto 1:fec69401b978 9 if(c == 0x00)
ryouheitakamoto 1:fec69401b978 10 ;
ryouheitakamoto 0:c5c02975ae0c 11 if(c == 0xfd){
ryouheitakamoto 0:c5c02975ae0c 12 break;
ryouheitakamoto 0:c5c02975ae0c 13 }
ryouheitakamoto 0:c5c02975ae0c 14 else{
ryouheitakamoto 0:c5c02975ae0c 15 printf("%02hhx ",c);
ryouheitakamoto 0:c5c02975ae0c 16 }
ryouheitakamoto 0:c5c02975ae0c 17 }
ryouheitakamoto 0:c5c02975ae0c 18 }
ryouheitakamoto 0:c5c02975ae0c 19
ryouheitakamoto 0:c5c02975ae0c 20 int main()
ryouheitakamoto 0:c5c02975ae0c 21 {
ryouheitakamoto 0:c5c02975ae0c 22 device.baud(9600);
ryouheitakamoto 0:c5c02975ae0c 23 pc.baud(921600);
ryouheitakamoto 0:c5c02975ae0c 24 while(1) {
ryouheitakamoto 0:c5c02975ae0c 25 char c = device.getc();
ryouheitakamoto 0:c5c02975ae0c 26
ryouheitakamoto 0:c5c02975ae0c 27 if(c == 0xfe) {
ryouheitakamoto 1:fec69401b978 28
ryouheitakamoto 0:c5c02975ae0c 29 while(1) {
ryouheitakamoto 0:c5c02975ae0c 30 c = device.getc();
ryouheitakamoto 0:c5c02975ae0c 31 if(c == 0x00){
ryouheitakamoto 1:fec69401b978 32
ryouheitakamoto 0:c5c02975ae0c 33 doppler();
ryouheitakamoto 0:c5c02975ae0c 34 printf("\r\n");
ryouheitakamoto 0:c5c02975ae0c 35 break;
ryouheitakamoto 0:c5c02975ae0c 36 }
ryouheitakamoto 1:fec69401b978 37
ryouheitakamoto 0:c5c02975ae0c 38 }
ryouheitakamoto 0:c5c02975ae0c 39 }
ryouheitakamoto 0:c5c02975ae0c 40 }
ryouheitakamoto 0:c5c02975ae0c 41 }
ryouheitakamoto 0:c5c02975ae0c 42
ryouheitakamoto 0:c5c02975ae0c 43
ryouheitakamoto 0:c5c02975ae0c 44