int main(void)
{
//short aacx,aacy,aacz; //???????????÷????????
//short gyrox,gyroy,gyroz; //??????????????
//short temp; //????
delay_init(); //?????????±????
uart_init(115200); //???????®???¨??????500000
IIC_Init();
while(1)
{
delay_ms(5000);
//count= MPU_Read_Byte(AK8975_RA_WIA);
//printf("%c",count);
//MPU_Read_Byte(AK8975_RA_INFO)
// MPU_Write_Byte(AK8975_RA_CNTL,AK8975_MODE_SINGLE);
delay_ms(10);
MPU_Read_Len(AK8975_DEFAULT_ADDRESS, AK8975_RA_HXL,6,buffer);
x=((u16)buffer[0]<<8)|buffer[1];
y=((u16)buffer[2]<<8)|buffer[3];
z=((u16)buffer[4]<<8)|buffer[5];
//x=(buffer[1]<<8)|buffer[0];
//y=(buffer[3]<<8)|buffer[2];
//z=(buffer[5]<<8)|buffer[4];
printf("%c%c%c",x,y,z);
}
}
为什么数据读不出来