Specification Sheet

BWT61CL | Datasheet v20-0630 | http://wiki.wit-motion.com/english
- 17 -
6.3 Date Analysis and Sample Code
double a[3],w[3],Angle[3],T;
void DecodeIMUData(unsigned char chrTemp[])
{
switch(chrTemp[1])
{
case 0x51:
a[0] = (short(chrTemp[3]<<8|chrTemp[2]))/32768.0*16;
a[1] = (short(chrTemp[5]<<8|chrTemp[4]))/32768.0*16;
a[2] = (short(chrTemp[7]<<8|chrTemp[6]))/32768.0*16;
T = (short(chrTemp[9]<<8|chrTemp[8]))/340.0+36.25;
break;
case 0x52:
w[0] = (short(chrTemp[3]<<8|chrTemp[2]))/32768.0*2000;
w[1] = (short(chrTemp[5]<<8|chrTemp[4]))/32768.0*2000;
w[2] = (short(chrTemp[7]<<8|chrTemp[6]))/32768.0*2000;
T = (short(chrTemp[9]<<8|chrTemp[8]))/340.0+36.25;
break;
case 0x53:
Angle[0] = (short(chrTemp[3]<<8|chrTemp[2]))/32768.0*180;