求大神帮忙给看看 MPU6050的数据分析对不对
void Get_Balanvce_Manage(void)
{
MPU6050ReadAcc(); //¶ÁÈ¡½ÇËÙ¶ÈÖµ
MPU6050ReadGyro(); //¶ÁÈ¡¼ÓËÙµÄÖµ
accData_x = accData_x-500;
gyroData_x=gyroData_x-26;
if(accData_x>32768) // ±È½ÏÊÇ·ñ´óÓÚÖмäÖµ ·´·½Ïò
{
ACC_flag = 65536-accData_x; //Êý¾ÝÀàÐÍת»»
ACC_X = asin((float)ACC_flag/16384)*180*100/314; //µÃµ½½Ç¶È ·´·½Ïò
}
else
{
ACC_X = asin((float)accData_x/16384)*180*100/314; //Õý·½Ïò µÃµ½½Ç¶È
}
//************************************************************************//
// ACCGEL_X = ACC_X ; //¼ÆËãÇã½Ç
// gyroData_x = gyroData_x+55;
if( gyroData_x >32768) // Õý½ÇËÙ¶È
{
GYRO_X = 65536-gyroData_x; //Êý¾ÝÀàÐÍת»»
// GYRO_X = GYRO_X*10/164 ;
}
else //·´·½Ïò½ÇËÙ¶È
{
// GYRO_X = gyroData_x*10/164 ;
GYRO_X = gyroData_x;
}
// Kalman_Filter( ACCGEL_X, GYRO_flag );//¿¨¶ûÂüÂ˲¨
// Angle_Balance=angle; //¸üÐÂƽºâÇã½Ç
}
|