在STM32Z轴加速度为: 上调试MPU6050时,通过串口的输出数据位
X轴加速度为: 3.219 m/s*s
Y轴加速度为: 4.248 m/s*s
Z轴加速度为: 7.507 m/s*s
X_speed 0.000 /s
Y_speed 69.726 /s
Z_speed 0.004 /s
X轴加速度为: 3.078 m/s*s
Y轴加速度为: 4.262 m/s*s
Z轴加速度为: 7.549 m/s*s
X_speed 69.697 /s
Y_speed 0.005 /s
Z_speed 0.012 /s
X轴加速度为: 3.032 m/s*s
Y轴加速度为: 4.312 m/s*s
Z轴加速度为: 7.540 m/s*s
X_speed 69.699 /s
Y_speed 69.736 /s
Z_speed 0.013 /s
X轴加速度为: 3.043 m/s*s
Y轴加速度为: 4.333 m/s*s
Z轴加速度为: 7.528 m/s*s
X_speed 69.699 /s
Y_speed 69.737 /s
Z_speed 0.014 /s
部分程序:
#define ACCEL_CONFIG 0x1C //?????????????????,???:0x01(???,2G,5Hz)
#define ACCEL_XOUT_H 0x3B
#define ACCEL_XOUT_L 0x3C
#define ACCEL_YOUT_H 0x3D
#define ACCEL_YOUT_L 0x3E
#define ACCEL_ZOUT_H 0x3F
#define ACCEL_ZOUT_L 0x40
#define TEMP_OUT_H 0x41
#define TEMP_OUT_L 0x42
#define GYRO_XOUT_H 0x43
#define GYRO_XOUT_L 0x44
#define GYRO_YOUT_H 0x45
#define GYRO_YOUT_L 0x46
#define GYRO_ZOUT_H 0x47
#define GYRO_ZOUT_L 0x48
#define PWR_MGMT_1 0x6B //????,???:0x00(????)
#define WHO_AM_I 0x75 //IIC?????(????0x68,??)
#define SlaveAddress 0xD0 //IIC??????????,+1???
/** @addtogroup STM32F10x_StdPeriph_Examples
//printf("\r\n\n\n WWW.ARMJISHU. configured....");
ac_x=getdate(ACCEL_XOUT_H);
aac_x=(ac_x/16384.0f)*9.81f;
printf("XÖá¼ÓËÙ¶ÈΪ£º%8.3f m/s*s\n", aac_x );
ac_y=getdate(ACCEL_YOUT_H);
aac_y=(ac_y/16384.0f)*9.81f;
printf("YÖá¼ÓËÙ¶ÈΪ£º%8.3f m/s*s\n", aac_y );
ac_z=getdate(ACCEL_ZOUT_H);
aac_z=(ac_z/16384.0f)*9.81f;
printf("ZÖá¼ÓËÙ¶ÈΪ£º%8.3f m/s*s\n", aac_z );
a_x=getdate(GYRO_XOUT_H);
aa_x=(a_x/16.4f)/57.3f;
printf("X_speed %4.3f /s\n", aa_x );
a_y=getdate(GYRO_YOUT_H);
aa_y=(a_y/16.4f)/57.3f;
printf("Y_speed %4.3f /s\n", aa_y );
a_z=getdate(GYRO_ZOUT_H);
aa_z=(a_z/16.4f)/57.3f;
printf("Z_speed %4.3f /s\n", aa_z );
Delay_Ms(5000);
不知道计算哪里有问题
GYRO_XOUT与 GYRO_YOUT 这两个数具体是什么意思啊、、一直不为零 |