您的位置:首页 > 其它

stm32控制mpu9250九轴传感器

2017-08-13 22:51 113 查看

MPU9250:

1.hardware

mpu mpu9250

同时新增加一个DMP文件夹

2.hallib



3.设置









记得要define,同时屏蔽部分代码,不然报错。同时上位机的波特率要设置好,同时关掉数据校验。

4.main

#include "mpu.h"
#include "mpu9250.h"
#include "inv_mpu.h"
#include "inv_mpu_dmp_motion_driver.h"
u8 t1=0,report=1;               //默认开启上报
u8 key1;
float pitch,roll,yaw;           //欧拉角
short aacx,aacy,aacz;           //加速度传感器原始数据
short gyrox,gyroy,gyroz;        //陀螺仪原始数据
short temp1;                    //温度
MPU9250_Init();                 //初始化MPU9250
其余的直接复制就行


5.效果

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  stm32 mpu9250