I want to calibrate an IMU Sensor to a decimal precision. I'm programming in C. I've defined a structure called accelerations with their variables x, y and z in int16_t format.
The raw values that I get (for the x, y and z Axis respectively) from the register reading(i.e. in accelerations) are for example: 218 -924 16312
The problem that I'm facing, is that by doing the calibration's multiplication
accelerations.x = (1*0.0006*(accelerations.x)-0.1681);
accelerations.y = (1*0.0006*(accelerations.y)+0.8076);
accelerations.z = (1*0.0006*(accelerations.z)-0.1698);
the values are rounded to integers, resulting in an output as follow: 0 0 9
What am I missing here?