Abstraction for the glider class
Diff: Glider.cpp
- Revision:
- 16:7e1a1cd9f9fb
- Parent:
- 15:5fea9af1cdb7
- Child:
- 18:a4fbe3ce0f16
--- a/Glider.cpp Thu May 11 14:49:26 2017 +0000 +++ b/Glider.cpp Mon May 15 13:51:30 2017 +0000 @@ -57,13 +57,14 @@ void Glider::saveTelem() { FILE *fp = fopen("/telem/telem.csv", "a"); - fprintf(fp, "3387, GLIDER, %d, %u, %f, %f, %f, %f, %f, %u\r\n", + fprintf(fp, PACKET_FORMAT, this->missionTime, //duration in seconds this->packetCount, this->alt, //meters this->pressure, // this->temp, //C this->speed, //m per s + this->solarVoltage, this->heading, //degrees from North this->state); fclose(fp); @@ -97,11 +98,9 @@ } void Glider::transmitPacket() { - //TODO: transmit - // voltage this->packetCount++; - this->xbee->printf("3387, GLIDER, %d, %d, %f, %f, %f, %f, %f, %f, %d\r\n", + this->xbee->printf(PACKET_FORMAT, this->missionTime, //duration in seconds this->packetCount, this->alt, //meters @@ -124,9 +123,6 @@ switch (command) { case CMD_BUZZER: //'b' was recieved. sound the buzzer this->state = LAND; //set state to land - //this->transmitPacket(); //transmit one last packet - //this->soundBuzzer(BUZZER_FREQ, 1, true); //sound buzzer forever - //while (1); break; case CMD_RESET: //'z' was recieved xbee->printf("resetting save file...\r\n"); @@ -135,8 +131,6 @@ packetCount = 0; startTime = 0; saveData(); - //remove("/telem/data.txt"); - //this->initSaveData(); break; }