Abstraction for the glider class
Glider.h@8:7fc2caa10bbb, 2017-04-15 (annotated)
- Committer:
- chasefarmer2808
- Date:
- Sat Apr 15 00:18:17 2017 +0000
- Revision:
- 8:7fc2caa10bbb
- Parent:
- 7:dc93fe573846
- Child:
- 9:8e34e713e6ef
bmp data
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chasefarmer2808 | 0:4e6b53a7bd38 | 1 | #ifndef Glider_H |
chasefarmer2808 | 0:4e6b53a7bd38 | 2 | #define Glider_H |
chasefarmer2808 | 0:4e6b53a7bd38 | 3 | |
chasefarmer2808 | 0:4e6b53a7bd38 | 4 | #include "mbed.h" |
chasefarmer2808 | 0:4e6b53a7bd38 | 5 | #include <string> |
chasefarmer2808 | 0:4e6b53a7bd38 | 6 | #include "HMC5883L.h" |
chasefarmer2808 | 0:4e6b53a7bd38 | 7 | #include "BMP180.h" |
chasefarmer2808 | 0:4e6b53a7bd38 | 8 | |
chasefarmer2808 | 6:bb82dd1618c2 | 9 | #define SAVE_DATA_FORMAT "%d %d %d" |
chasefarmer2808 | 6:bb82dd1618c2 | 10 | #define CMD_BUZZER 'b' |
chasefarmer2808 | 6:bb82dd1618c2 | 11 | #define CMD_RESET 'r' |
chasefarmer2808 | 6:bb82dd1618c2 | 12 | |
chasefarmer2808 | 4:ff59603d9fb6 | 13 | #define FREQ 1.0 |
chasefarmer2808 | 6:bb82dd1618c2 | 14 | #define CRUZE 0 |
chasefarmer2808 | 6:bb82dd1618c2 | 15 | #define LAND 1 |
chasefarmer2808 | 3:d8932a3036a8 | 16 | |
chasefarmer2808 | 0:4e6b53a7bd38 | 17 | class Glider { |
chasefarmer2808 | 0:4e6b53a7bd38 | 18 | public: |
chasefarmer2808 | 0:4e6b53a7bd38 | 19 | Serial* dev; |
chasefarmer2808 | 1:7039ae86fe70 | 20 | Serial* xbee; |
chasefarmer2808 | 0:4e6b53a7bd38 | 21 | double heading; |
chasefarmer2808 | 0:4e6b53a7bd38 | 22 | float pressure; |
chasefarmer2808 | 0:4e6b53a7bd38 | 23 | float temp; |
chasefarmer2808 | 0:4e6b53a7bd38 | 24 | float alt; |
chasefarmer2808 | 6:bb82dd1618c2 | 25 | bool cmdFlag; |
chasefarmer2808 | 4:ff59603d9fb6 | 26 | bool transmitFlag; |
chasefarmer2808 | 7:dc93fe573846 | 27 | time_t startTime; //saved data |
chasefarmer2808 | 7:dc93fe573846 | 28 | time_t missionTime; |
chasefarmer2808 | 7:dc93fe573846 | 29 | uint8_t packetCount; //saved data |
chasefarmer2808 | 6:bb82dd1618c2 | 30 | uint8_t state; //saved data |
chasefarmer2808 | 0:4e6b53a7bd38 | 31 | HMC5883L* hmc; |
chasefarmer2808 | 0:4e6b53a7bd38 | 32 | BMP180* bmp; |
chasefarmer2808 | 1:7039ae86fe70 | 33 | Glider(Serial* device, PinName sda, PinName scl, PinName tx, PinName rx); |
chasefarmer2808 | 2:cc07e65227ff | 34 | InterruptIn xbeeRxInt; |
chasefarmer2808 | 0:4e6b53a7bd38 | 35 | void setHeading(); |
chasefarmer2808 | 8:7fc2caa10bbb | 36 | void setTempPressAlt(); |
chasefarmer2808 | 1:7039ae86fe70 | 37 | void setMissionTime(); |
chasefarmer2808 | 4:ff59603d9fb6 | 38 | void setTransmitFlag(); |
chasefarmer2808 | 5:460412fc4a17 | 39 | void initSaveData(); |
chasefarmer2808 | 0:4e6b53a7bd38 | 40 | void saveTelem(); |
chasefarmer2808 | 2:cc07e65227ff | 41 | void saveData(); |
chasefarmer2808 | 1:7039ae86fe70 | 42 | void transmitPacket(); |
chasefarmer2808 | 3:d8932a3036a8 | 43 | void setCommandFlag(); |
chasefarmer2808 | 2:cc07e65227ff | 44 | void processCommand(); |
chasefarmer2808 | 0:4e6b53a7bd38 | 45 | }; |
chasefarmer2808 | 0:4e6b53a7bd38 | 46 | |
chasefarmer2808 | 1:7039ae86fe70 | 47 | #endif |