Thanks for the link jremington.
Hope I can find some insights to answer these questions in this tutorial and related links.
EDIT:
Reading a post that was linked (post), it is said that the considered accelerometer offset register had a 12-bit alignment, which justified a division by 16 (24). Here is the code of this part:
void loop()
{
compass.read();
float Xa_print, Ya_print, Za_print;
Xa_print = compass.a.x/16.0; //Acceleration data registers contain a left-aligned 12-bit number, so values should be shifted right by 4 bits (divided by 16)
Ya_print = compass.a.y/16.0;
Za_print = compass.a.z/16.0;
}
But I really can't grasp this process... Xa_print is a float, a 32-bit data type, why do I have to divide by 24 to put it on a 12-bit register? In fact, I could not understand what is this 12-bit aligned number...
Moreover, from the read of the tutorial, I understood that offsets really act on just the already sampled values, right? In other words, they can't avoid overflow due to high excitation outside the programmed accelerometer range, right? I just don't want to misunderstand something in the post.
Best regards.