新手上路
- 积分
- 28
- 金钱
- 28
- 注册时间
- 2020-2-3
- 在线时间
- 5 小时
|
mpu6000用SPI方式读到了原始数据,但是使用mpu6050的DMP库,却过不了自检,怎么办呀,有没有现成的DMP库呀
。
#define i2c_write MPU_Write_Len
#define i2c_read mpu6000SpiReadRegister//加入了IIC所需要的地址但不做任何操作。
u8 MPU_Write_Len(u8 addr,u8 reg ,u8 len,u8 *buf)
{
u8 i;
ENABLE_MPU6000();
delay_ms(1);
SPI_I2S_WriteByte(reg|0x00);
for(i=0;i<len;i++)
{SPI_I2S_WriteByte(buf[i]);
}
DISABLE_MPU6000();
delay_ms(1);
return 0;
}
u8 mpu6000SpiReadRegister(u8 addr,u8 reg, u8 lenth,u8 *data)
{
// u8 data;
ENABLE_MPU6000();
SPI_I2S_WriteByte(0x80|reg);
spi1Transfe(data,NULL,lenth);
DISABLE_MPU6000();
return 0;
}
求大神指点。
|
|