format of datalog to be written in bin files

hi, i would like to know what and how the format of data long looks like when written on bin file in px/apm. i have tried writing one on my own using Arduino IDE but it did not work out. i tried including the headers, followed by the parameters like roll, yaw, pitch etc. may i know whether this is the correct way of doing? i have also seen the original codes/libraries but still dont work out. i need help on this and wanted to know how the log file being written for my education purpose, please advice, thanks.

here is the program in arduino IDE

#define HEAD_BYTE1 0xA3 // Decimal 163
#define HEAD_BYTE2 0x95 // Decimal 149

void setup() {

// include all init as well as SD init

File myFile = SD.open("test.BIN", FILE_WRITE);
if (myFile)
{

myFile.print(HEAD_BYTE1);
myFile.print(HEAD_BYTE2);

myFile.print(2); //LOG_ATTITUDE
myFile.print(45); //any parameter value 
myFile.print(23); //any parameter value 
myFile.print(42);  //any parameter value 

myFile.close();
}

}

void loop()

{

}

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…