距離推定3

Dependencies:   mbed

Revision:
0:bd0a2325eb65
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Oct 12 09:01:09 2018 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+#include <stdio.h>
+
+int main(void) {
+  float culculate_distance_3(float a,float b);
+  float a,b,c;
+  a=3;//加速度センサから求めた距離
+  b=8;//フォトから求めた距離
+  
+  printf("distance3=%f",culculate_distance_3(a,b));
+  return 0;
+}
+
+//二つの距離から一つの距離を算出
+
+float culculate_distance_3(float a,float b) {
+ float c; 
+ c=0.5*a+0.5*b;//今は平均。計測をもとに修正を加える
+  return c;
+}
+}