/* 读取X,Y,Z的加速度值 */
ADX_GetXYZData(&Xval, &Yval, &Zval);
printf(" x:%d \n", Xval);
printf(" y:%d \n", Yval);
printf(" z:%d \n", Zval);
/* 将读取到的加速度值转换为角度值 */
Xang=ADX_GetAngle(Xval, Yval, Zval,1);
Yang=ADX_GetAngle(Xval, Yval, Zval,2);
Zang=ADX_GetAngle(Xval, Yval, Zval,0);
GUI_DisplayData();
|