How do I measure the distance traveled by an iPhone using the accelerometer?
<p>While GPS works for long distance changes, I would like to measure a shorter distance by using the iPhone's accelerometer.</p>

<p>Say I want to measure a height of a box using an iPhone application.  You'd start the application, press a button to start measurement at the bottom of a box, move your iPhone from to the top of the box, then press a button to stop measurement.  The application would then calculate and display the height of the box.</p>

<p>How would I use the accelerometer to perform this kind of measurement?</p>
