簡體   English   中英

為什么在teapotPacket []數組中沒有傳遞索引2,3,6,7,10,11的“fifoBuffer”值?

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

我正在使用Jeff Rowberg的MPU6050庫。 在代碼中,整個fifobuffer不會傳遞給'teapotPacket'數組(用於處理,即圖形仿真)。 為什么只有某些索引在'teapotPacket'數組中傳遞?(確切地說,只傳遞下面給出的索引)

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];

請澄清一下,為什么'teapotPacket'數組用$,十六進制數字和'\\ n'&'\\ r'字符初始化?

uint8_t teapotPacket[14] = { '$', 0x02, 0,0, 0,0, 0,0, 0,0, 0x00, 0x00, '\r', '\n' };

問題重復: 為什么在teapotPacket []數組中沒有傳遞索引2,3,6,7,10,11的“fifoBuffer”值?

再次引用我的答案以獲得完整性:

在代碼中,在將數據傳遞到Teapot庫(用於處理,即圖形仿真)時,不傳遞整個fifobuffer。 為什么會這樣 ?

深入研究庫代碼,我發現它只是一個用於顯示四元數值的“InvenSense Teapot demo”格式。

為什么用這些奇怪的十六進制數字初始化teapotPacket [14]數組?

它是InvenSense茶壺的數據包結構格式,用於存儲四元數值等傳感器讀數。

關於以下內容的更多信息:“四元數值”:

四元數是一個數字系統,它擴展了用於涉及三維旋轉的計算的復數,例如三維計算機圖形,計算機視覺和晶體學紋理分析。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM