Abstraction for the glider class

Dependents:   DropTest

Committer:
chasefarmer2808
Date:
Thu Apr 13 15:38:09 2017 +0000
Revision:
6:bb82dd1618c2
Parent:
5:460412fc4a17
Child:
7:dc93fe573846
saves state

Who changed what in which revision?

UserRevisionLine numberNew 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 2:cc07e65227ff 6 #include <sstream>
chasefarmer2808 0:4e6b53a7bd38 7 #include "HMC5883L.h"
chasefarmer2808 0:4e6b53a7bd38 8 #include "BMP180.h"
chasefarmer2808 0:4e6b53a7bd38 9
chasefarmer2808 6:bb82dd1618c2 10 #define SAVE_DATA_FORMAT "%d %d %d"
chasefarmer2808 6:bb82dd1618c2 11 #define CMD_BUZZER 'b'
chasefarmer2808 6:bb82dd1618c2 12 #define CMD_RESET 'r'
chasefarmer2808 6:bb82dd1618c2 13
chasefarmer2808 4:ff59603d9fb6 14 #define FREQ 1.0
chasefarmer2808 6:bb82dd1618c2 15 #define CRUZE 0
chasefarmer2808 6:bb82dd1618c2 16 #define LAND 1
chasefarmer2808 3:d8932a3036a8 17
chasefarmer2808 0:4e6b53a7bd38 18 class Glider {
chasefarmer2808 0:4e6b53a7bd38 19 public:
chasefarmer2808 0:4e6b53a7bd38 20 Serial* dev;
chasefarmer2808 1:7039ae86fe70 21 Serial* xbee;
chasefarmer2808 0:4e6b53a7bd38 22 double heading;
chasefarmer2808 0:4e6b53a7bd38 23 float pressure;
chasefarmer2808 0:4e6b53a7bd38 24 float temp;
chasefarmer2808 0:4e6b53a7bd38 25 float alt;
chasefarmer2808 6:bb82dd1618c2 26 bool cmdFlag;
chasefarmer2808 4:ff59603d9fb6 27 bool transmitFlag;
chasefarmer2808 1:7039ae86fe70 28 time_t startTime;
chasefarmer2808 6:bb82dd1618c2 29 time_t missionTime; //saved data
chasefarmer2808 6:bb82dd1618c2 30 uint8_t packetCount; //daved data
chasefarmer2808 6:bb82dd1618c2 31 uint8_t state; //saved data
chasefarmer2808 0:4e6b53a7bd38 32 HMC5883L* hmc;
chasefarmer2808 0:4e6b53a7bd38 33 BMP180* bmp;
chasefarmer2808 1:7039ae86fe70 34 Glider(Serial* device, PinName sda, PinName scl, PinName tx, PinName rx);
chasefarmer2808 2:cc07e65227ff 35 InterruptIn xbeeRxInt;
chasefarmer2808 0:4e6b53a7bd38 36 void setHeading();
chasefarmer2808 0:4e6b53a7bd38 37 void setTempPress();
chasefarmer2808 1:7039ae86fe70 38 void setMissionTime();
chasefarmer2808 4:ff59603d9fb6 39 void setTransmitFlag();
chasefarmer2808 5:460412fc4a17 40 void initSaveData();
chasefarmer2808 0:4e6b53a7bd38 41 void saveTelem();
chasefarmer2808 2:cc07e65227ff 42 void saveData();
chasefarmer2808 1:7039ae86fe70 43 void transmitPacket();
chasefarmer2808 3:d8932a3036a8 44 void setCommandFlag();
chasefarmer2808 2:cc07e65227ff 45 void processCommand();
chasefarmer2808 0:4e6b53a7bd38 46 };
chasefarmer2808 0:4e6b53a7bd38 47
chasefarmer2808 1:7039ae86fe70 48 #endif