Measures orientation as a quaternion as well as Euler angles. v1 reported implausible drift near the upright pose, which is a known weakness of Euler angles rather than of the hardware — this version reports both so they can be compared.
Prop the phone upright — portrait, camera at a wall, the way you
will hold it shooting. Hands off for 20 seconds.
Away from metal and electronics. The compass is a magnetometer; a laptop,
fridge or radiator will bend the reading. Book or mug, on wood or plastic.
Hold it up, turn a full circle on the spot, stop exactly where you
started, then tap Finish. About five seconds.
Aim at a sharp vertical edge — door frame, window frame, room corner. This
measures sensor error and aiming error together, so a crisp reference keeps the
number honest about the phone.