added example of accessing magnetometer