用的是圆点DMP库。把陀螺仪初始化的每一步骤通过串口打印出来,会出现:“加载dmp固件失败 ,,,,使能DMP失败”。程序如下:[mw_shl_code=applescript,true]u8 AnBT_DMP_MPU6050_Init(void)
{
AnBT_DMP_MPU6050_DEV_CFG(); //etootle: init the mpu6050 chip
AnBT_Uart1_Send_String("P-1,Finish DMP device init.",27);
//
if(!mpu_set_sensors(INV_XYZ_GYRO | INV_XYZ_ACCEL)) AnBT_Uart1_Send_String("P-2,Finish DMP set sensor.",26);
else AnBT_Uart1_Send_String("P-2,DMP set sensor error.",25);
//
if(!mpu_configure_fifo(INV_XYZ_GYRO | INV_XYZ_ACCEL)) AnBT_Uart1_Send_String("P-3,Finish DMP configure fifo.",30);
else AnBT_Uart1_Send_String("P-3,DMP configure fifo error.",29);
//
if(!mpu_set_sample_rate(DEFAULT_MPU_HZ))AnBT_Uart1_Send_String("P-4,Finish DMP set sample rate.",31);
else AnBT_Uart1_Send_String("P-4,DMP set sample_rate error.",30);
//
if(!dmp_load_motion_driver_firmware()) AnBT_Uart1_Send_String("P-5,Finish DMP load motion driver firmware.",43);
else AnBT_Uart1_Send_String("P-5,DMP load motion driver firmware error.",42);
//
if(!dmp_set_orientation(inv_orientation_matrix_to_scalar(gyro_orientation))) AnBT_Uart1_Send_String("P-6,Finish DMP set orientation.",31);
else AnBT_Uart1_Send_String("P-6,DMP set orientation error.",30);
//
if(!dmp_enable_feature(DMP_FEATURE_6X_LP_QUAT | DMP_FEATURE_TAP |
DMP_FEATURE_ANDROID_ORIENT | DMP_FEATURE_SEND_RAW_ACCEL | DMP_FEATURE_SEND_CAL_GYRO |
DMP_FEATURE_GYRO_CAL)) AnBT_Uart1_Send_String("P-7,Finish DMP enable feature.",30);
else AnBT_Uart1_Send_String("P-7,DMP enable feature error.",29);
//
if(!dmp_set_fifo_rate(DEFAULT_MPU_HZ)) AnBT_Uart1_Send_String("P-8,Finish DMP set fifo rate.",29);
else AnBT_Uart1_Send_String("P-8,DMP set fifo rate error.",28);
//
run_self_test();
if(!mpu_set_dmp_state(1)) AnBT_Uart1_Send_String("P-9,Finish DMP set dmp state.",29);
else AnBT_Uart1_Send_String("P-9,DMP set dmp state error.",28);
//
return 0;
}[/mw_shl_code]
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
DMP加载固件库失败的概率为10%左右,是什么原因呢?不是用杜邦线连接的。
I2C速率也调整过的,你们说的调整堆栈大小是什么意思?
一周热门 更多>