初级会员

- 积分
- 61
- 金钱
- 61
- 注册时间
- 2015-1-19
- 在线时间
- 0 小时
|

楼主 |
发表于 2015-6-2 11:31:33
|
显示全部楼层
回复【2楼】zuozhongkai:
---------------------------------
非常感谢!可以用!
但是又出现一个问题。。
打印数据如下:
51
3
3
3
51
3
3
3
51
总是有个51出现。这个会不会是溢出导致的?还是他真的用了那么久?
代码如下:
timeUsed = OSTimeGet();
if(t==8)LED0=1; //LED0灭
if(t==100) //LED0亮
{
t=0;
LED0=0;
}
//short temp;
if(mpu_dmp_get_data(&pitch,&roll,&yaw)==0)
{
//temp=MPU_Get_Temperature(); //得到温度值
MPU_Get_Accelerometer(&aacx,&aacy,&aacz); //得到加速度传感器数据
MPU_Get_Gyroscope(&gyrox,&gyroy,&gyroz); //得到陀螺仪数据
#if defined MPU0_DEBUG
printf("\n%f,%f,%f\r\n",pitch,roll,yaw);
#endif
//if(report)mpu6050_send_data(aacx,aacy,aacz,gyrox,gyroy,gyroz);//用自定义帧发送加速度和陀螺仪原始数据
//if(report)usart1_report_imu(aacx,aacy,aacz,gyrox,gyroy,gyroz,(int)(roll*100),(int)(pitch*100),(int)(yaw*10));
//OSSemPost(sem_led1); //show it's working
}
timeUsed = OSTimeGet()-timeUsed;
printf("%d\n",timeUsed); |
|