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: BufferedSoftSerial2 INA226_ver1 mbed-rtos mbed SDFileSystem-RTOS
Fork of keiki2017 by
Diff: Fusokukei.h
- Revision:
- 13:09e05e7cfca1
- Parent:
- 7:9415448ae9ca
- Child:
- 15:6966299bea4c
--- a/Fusokukei.h Sat Nov 12 12:03:02 2016 +0000 +++ b/Fusokukei.h Sat Nov 19 10:50:35 2016 +0000 @@ -4,7 +4,7 @@ #include "mbed.h" -#define AIR_K 0.14737 +#define AIR_K 4.70581884 //0.14737 #define AIR_N 1.12 #define AIR_A 1.4314 #define AIR_B 0.209 @@ -18,6 +18,7 @@ float air_sum[AIR_SUM_NUM] = {0.0}; class Fusokukei{ + double r; protected: public: @@ -34,7 +35,8 @@ } void calcAirSpeed(float x){ - air_sum[air_counter % AIR_SUM_NUM] = (float)AIR_K * (float)pow((double)x, 1 / AIR_N); + r = x/150; + air_sum[air_counter % AIR_SUM_NUM] = (float)AIR_K * (float)pow(r, 1 / AIR_N); if(air_counter % AIR_SUM_NUM == 0) air_counter = 0; airSpeed_ave = make_ave(air_sum, AIR_SUM_NUM);