doppler shift / Mbed 2 deprecated calsat32_3

Dependencies:   mbed

main.cpp

Committer:
ryouheitakamoto
Date:
2020-12-11
Revision:
0:c5c02975ae0c
Child:
1:fec69401b978

File content as of revision 0:c5c02975ae0c:

#include "mbed.h"

Serial pc(SERIAL_TX, SERIAL_RX);
Serial device(PA_9,PA_10);

void doppler(){
    while(1){
        char c = device.getc();
        if(c == 0xfd){
            break;
            }
        else{
            printf("%02hhx ",c);
            }
        }
    }
    
int main()
{
    device.baud(9600);
    pc.baud(921600);
    while(1) {
        char c = device.getc();

        if(c == 0xfe) {
            //pc.printf("%02hhx ",c);
            while(1) {
                c = device.getc();
                if(c  == 0x00){
                    //pc.printf("%02hhx\r\n ",c);
                    doppler();
                    printf("\r\n");
                    break;
                    }
                else{
                    //pc.printf("%02hhx ",c);
                    
                }
            }
        }
    }
}