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
Diff: main.cpp
- Revision:
- 0:4eeab953c09c
- Child:
- 1:3d373c17be18
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Dec 28 03:49:08 2020 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+/*ドップラーシフト対策 calsatが計算した周波数のデータを評価ボードに与える*/
+Serial pc(SERIAL_TX, SERIAL_RX,921600);
+Serial device(PA_9,PA_10,9600);
+
+int main()
+{
+ int n;
+ n = 123456789;
+ double data = n * 2 / 19.68;
+ int Integer_data = int(data);
+ int Decimal_data = 0;
+ double Dec = (data - Integer_data);
+ int i = 1;
+
+
+ while(1) {
+ if(i*(1.0 / 32768) > Dec ) {
+ Decimal_data = i;
+ break;
+ }
+ i++;
+ }
+
+ printf("Integer_data = %d\r\nDecimal_data = %d\r\n",Integer_data,Decimal_data);
+ return 0;
+
+}
\ No newline at end of file