In this tutorial we will look at Device Motion which provides various measurements from the sensors on the iPhone. The data is represented by the CMDeviceMotion class which encapsulates measurements taken by the onboard sensors.
Rather than providing raw values from the accelerometer, gyroscope, or magnetometer, the CMDeviceMotion class provides data that has been processed by “Core Motion’s sensor fusion algorithms”. The data is cleaned up, and has bias removed.
In todays tutorial we’re going to look at how to access CMDeviceMotion and create a simple needle that faces down regardless of the direction you rotate the phone around the Z axis. [Read more…]