I'm using the MPU6050 library by Jeff Rowberg. In the code, while passing data to the Teapot library(for processing,i.e, graphics emulation), whole fifobuffer is not passed. Why is that so ?
Here's the code, see only few indices of fifobuffer array are passed.
teapotPacket[2] = fifoBuffer[0];
teapotPacket[3] = fifoBuffer[1];
teapotPacket[4] = fifoBuffer[4];
teapotPacket[5] = fifoBuffer[5];
teapotPacket[6] = fifoBuffer[8];
teapotPacket[7] = fifoBuffer[9];
teapotPacket[8] = fifoBuffer[12];
teapotPacket[9] = fifoBuffer[13];
Further, also clarify one more thing,
uint8_t teapotPacket[14] = { '$', 0x02, 0,0, 0,0, 0,0, 0,0, 0x00, 0x00, '\r', '\n' };
Why the teapotPacket[14] array is initialised with these weird hex numbers ?
In the code, while passing data to the Teapot library(for processing,i.e, graphics emulation), whole fifobuffer is not passed. Why is that so ?
Digging deeper into the library code, I found out that its just a "InvenSense Teapot demo" format for displaying the quaternion values.
Why the teapotPacket[14] array is initialised with these weird hex numbers ?
Its a packet structure format for InvenSense teapot, used for storing the sensor readings like quaternion values.
A little more information about : "Quaternion values" :
Quaternions is a number system that extends the complex numbers used for calculations involving three-dimensional rotations such as in three-dimensional computer graphics, computer vision, and crystallographic texture analysis.