AnsweredAssumed Answered

READ DATA OF MMA8452

Question asked by kaner cheng on Apr 25, 2017
Latest reply on Apr 27, 2017 by David Diaz Marin

    I am a rookie of using MMA8452, I want to read data of mma8452 to know the x,y,z;But I read data is always F and 4095,

please help me , thanks!!!

void Multiple_Read_MMA8452(void)
{
uchar i;
MMA8452_Start(); 
MMA8452_SendByte(0x38 )
MMA8452_SendByte(0x01);
MMA8452_Start(); 
MMA8452_SendByte(0x38 +1);
for (i=0; i<6; i++) 
{
BUF[i] = MMA8452_RecvByte(); 
if (i == 5)
{
MMA8452_SendACK((BitAction)1); 
}
else
{
MMA8452_SendACK((BitAction)0);
}
}
MMA8452_Stop(); 
Delay5ms();
}


void Init_MMA8452(void)
{
Single_Write_MMA8452(0x2A,0x01); //
Single_Write_MMA8452(0x2B,0x02); //

}

Outcomes