Hi BSTRobin, thanks for your sample code. I used it to compare the mine and understand the problem, at the end I have find out the problem in my code: in the library of the sensor, I modified one routine because, as it is implemented, it fail on compiling phase. The routine is "bma400_get_regs()" and the problem is the declaration of the local array "uint8_t temp_buff[(len + lun_dummy)] ", in which the dimension is fixed by using a variable, this is not allowed with XC8 compiler and I fixed it to 100bytes. So, it is not enought for all data, with a bigger array, data are correct and it are alligned with the position of the accelerometer. Marilena
... View more