Why “fifoBuffer” values of indexes 2,3,6,7,10,11 are not passed in the teapotPacket[] array?

痴心易碎 提交于 2019-12-25 05:32:43

问题


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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/42301784/why-fifobuffer-values-of-indexes-2-3-6-7-10-11-are-not-passed-in-the-teapotpac

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!