Abstraction for the glider class
Diff: Glider.h
- Revision:
- 9:8e34e713e6ef
- Parent:
- 8:7fc2caa10bbb
- Child:
- 10:4c4f0ea887a4
--- a/Glider.h Sat Apr 15 00:18:17 2017 +0000 +++ b/Glider.h Thu Apr 20 16:39:12 2017 +0000 @@ -3,6 +3,7 @@ #include "mbed.h" #include <string> +#include "math.h" #include "HMC5883L.h" #include "BMP180.h" @@ -14,6 +15,13 @@ #define CRUZE 0 #define LAND 1 +#define PITO_V_DIVIDER 0.6666 +#define PITO_ADC_RATIO 3.3 / 0xffff + +#define AIR_DENSITY 1.225 //kg per m3 + +//AnalogIn pitot(p15); + class Glider { public: Serial* dev; @@ -22,6 +30,7 @@ float pressure; float temp; float alt; + float speed; bool cmdFlag; bool transmitFlag; time_t startTime; //saved data @@ -32,8 +41,10 @@ BMP180* bmp; Glider(Serial* device, PinName sda, PinName scl, PinName tx, PinName rx); InterruptIn xbeeRxInt; + AnalogIn pitot; void setHeading(); void setTempPressAlt(); + void setAirSpeed(); void setMissionTime(); void setTransmitFlag(); void initSaveData();