Magnetometer example