Hello everyone I am trying to interface acceleration sensor Adxl345 to stm32f302 through I2C using the HAL Library. Actually I am learning the programming , does any one help me how to get the data from sensor. I wrote this code , it does not work it.
int x ;
HAL_I2C_Mem_Read(&hi2c3, 0x53<<1, 0x32, I2C_MEMADD_SIZE_8BIT, (uint8_t*)data, 2, 1000);
x = ( data<<8) |data;
could you give me idea where is mistake ?