Abstraction for the glider class
Diff: Glider.cpp
- Revision:
- 0:4e6b53a7bd38
- Child:
- 1:7039ae86fe70
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Glider.cpp Sun Apr 09 05:05:52 2017 +0000 @@ -0,0 +1,25 @@ +#include "Glider.h" + +Glider::Glider(Serial* device, PinName sda, PinName scl) { + dev = device; + dev->printf("constructing glider..."); + heading = 0; + telemetry = "hello"; + hmc = new HMC5883L(sda, scl); + bmp = new BMP180(sda, scl); + bmp->Initialize(1013.25, BMP180_OSS_ULTRA_LOW_POWER); +} + +void Glider::setHeading() { + this->heading = this->hmc->getHeadingXYDeg(); +} + +void Glider::setTempPress() { + bmp->ReadData(&this->temp, &this->pressure, &this->alt); +} + +void Glider::saveTelem() { + FILE *fp = fopen("/telem/telem.txt", "w"); + fprintf(fp, "hello,"); + fclose(fp); +} \ No newline at end of file