예제 #1
0
/*
 *   MPU6050_GetResult
 *   获得MPU6050结果
 *
 *   参数:
 *    无
 *
 *   返回值
 *    转换结果 
 */
int16 MPU6050_GetResult(uint8 Regs_Addr)
{
  int16 result,temp;
  result = MPU6050_ReadReg(Regs_Addr);
  temp   = MPU6050_ReadReg(Regs_Addr+1);
  result=result<<8;
  result=result|temp;
  return result;
}
예제 #2
0
/*====================================================================================================*/
int8_t MPU6050_Check( void )
{
    int8_t deviceID = ERROR;

    deviceID = MPU6050_ReadReg(MPU6050_WHO_AM_I);
    if(deviceID != MPU6050_Device_ID)
        return ERROR;

    return SUCCESS;
}