Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Figure 5-1. The iPhone accelerometer axes When dealing with acceleration measurements you must keep in mind that the accelerometer is measuring just that: the linear acceleration of the device. When at rest (in whatever orientation) the figures represent the force of gravity acting on the device, and correspond to the roll and pitch of the device (in the X and Y directions at least). But while in motion, the figures represent the acceleration due to gravity, plus the acceleration of the device itself relative to its rest frame. Writing an Accelerometer Application Let's implement a simple view-based application to illustrate how to approach the accelerometer. Open
Feedback: 0 Comments on this Section