I understand. But when you tilt it a little from level the X mag value does not change, of course.
When you first tilt it 15 deg towards N, then back and forth another 15, the Y,Z do not change.
Only the orientation values change in this case.
Will see if your code handles this.
Reading the source looks great!