智能车制作
标题:
LPLD V3.10库MPU6050例程输出都是-1,求解
[打印本页]
作者:
信田
时间:
2016-4-9 19:43
标题:
LPLD V3.10库MPU6050例程输出都是-1,求解
各位大神,有没有用LPLD V3.10的库,里面新出的MPU6050例程是有什么问题么?
我用串口输出采的数据都是-1,求指导哪里有问题
#include "common.h"
#include "DEV_MPU6050.h"
int16 accel_x,accel_y,accel_z,gyro_x,gyro_y,gyro_z;
float32 temperature;
void main()
{
MPU6050_Init();
while(1)
{
accel_x = MPU6050_GetResult(ACCEL_XOUT_H);
accel_y = MPU6050_GetResult(ACCEL_YOUT_H);
accel_z = MPU6050_GetResult(ACCEL_ZOUT_H);
gyro_x = MPU6050_GetResult(GYRO_XOUT_H);
gyro_y = MPU6050_GetResult(GYRO_YOUT_H);
gyro_z = MPU6050_GetResult(GYRO_ZOUT_H);
temperature = MPU6050_GetResult(TEMP_OUT_H)/340+36.53;
LPLD_SYSTICK_DelayMs(10);
printf("ax = %d",accel_x); printf(" ");
printf("ay = %d",accel_y); printf(" ");
printf("az = %d",accel_z); printf(" ");
printf("gx = %d",gyro_x); printf(" ");
printf("gy = %d",gyro_y); printf(" ");
printf("gz = %d",gyro_z); printf(" ");
printf("T = %d", temperature); printf("\r\n"); printf("\r\n");
LPLD_SYSTICK_DelayMs(10);
}
}
[attach]84836[/attach]
欢迎光临 智能车制作 (http://dns.znczz.com/)
Powered by Discuz! X3.2