Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Revision 4:6e9a233c748d, committed 2020-12-16
- Comitter:
- ryouheitakamoto
- Date:
- Wed Dec 16 14:44:35 2020 +0000
- Parent:
- 3:61e7dda0c14d
- Commit message:
- ok? _2;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Dec 16 06:30:01 2020 +0000 +++ b/main.cpp Wed Dec 16 14:44:35 2020 +0000 @@ -2,11 +2,14 @@ /*ドップラーシフト対策 calsatが計算した周波数のデータを受け取る*/ Serial pc(SERIAL_TX, SERIAL_RX); Serial device(PA_9,PA_10); +#define kHz 1000 +#define MHz 1000000 void doppler() //データを取得し、出力する関数 { int data[10] = {0}; int flag = 0; + int doppler = 0; while(1) { char c = device.getc(); if(c == 0x00) @@ -14,6 +17,10 @@ if(c == 0xfd) { //FD(終了コマンドがきたら終了 for(int i = 0; i < flag; i++) printf("%d ", data[i]); + + doppler = 10 * data[0] + data[1] + kHz * data[2] + 100 * data[3] + 100*kHz * data[4] + 10*kHz * data[5] + 10*MHz * data[6] + MHz * data[7] + data[8] + 100*MHz * data[9]; + printf("\n%d\n",doppler); + break; } else{