albatross / Mbed 2 deprecated keiki2018

Dependencies:   BufferedSoftSerial2 INA226_ver1 mbed-rtos mbed SDFileSystem-RTOS

Fork of keiki2017 by albatross

Branch:
noThread2017ver.
Revision:
27:d2955f29a3aa
Parent:
15:6966299bea4c
Child:
51:f391d3a02397
--- a/Fusokukei.h	Wed Jan 25 12:24:10 2017 +0000
+++ b/Fusokukei.h	Sat Jan 28 10:17:50 2017 +0000
@@ -4,7 +4,7 @@
 #include "mbed.h"
 
 
-#define AIR_K 4.70581884 //0.14737
+#define AIR_K 4.70591884 //0.14737
 #define AIR_N 1.12
 #define AIR_A 1.4314
 #define AIR_B 0.209
@@ -18,7 +18,6 @@
 float air_sum[AIR_SUM_NUM] = {0.0};
 
 class Fusokukei{
-    double air_r;
     protected:
     
     public:      
@@ -35,8 +34,7 @@
     }
     
     void calcAirSpeed(float x){
-          air_r = x/150;
-          air_sum[air_counter % AIR_SUM_NUM] = (float)AIR_K * (float)pow(air_r, 1 / AIR_N);
+          air_sum[air_counter % AIR_SUM_NUM] = (float)AIR_K * (float)pow((double)(x/150.0), 1 / AIR_N);
           if(air_counter % AIR_SUM_NUM == 0)
             air_counter = 0;
           airSpeed_ave = make_ave(air_sum, AIR_SUM_NUM);