### AccelerometerGraph ###
AccelerometerGraph sample application graphs the motion of the device. It demonstrates how to use the UIAccelerometer class and how to use Quartz2D and Core Animation to provide a high performance graph view. It also demonstrates a low-pass filter that you can use to isolate the effects of gravity, and a high-pass filter that you can use to remove the effects of gravity.
Run this sample on the device to learn how the accelerometer behaves when moving the device. The simulator does not simulate the accelerometer hardware, so you will not see any updates to the graph there. Use the controls provided to pause and resume updates, and to select a low pass or high pass filter, and to enable or disable adaptive filtering.
iOS 4.0 SDK
iPhone OS 3.2 or later
The application delegate class, responsible for application events and for bringing up the user interface.
Implements a low and high pass filter with optional adaptive filtering.
This class is responsible for updating and drawing the accelerometer history of values. This class uses Core Animation directly to control what parts of the graph are updated by drawing and what parts can be updated strictly by animation.
The view controller loaded by the application delegate that is responsible for handling user events, selecting the correct filter, and passing accelerometer data through the filter and into the GraphView.
Entry point for the application. Creates the application object, sets its delegate, and causes the event loop to start.
CHANGES FROM PREVIOUS VERSIONS:
- Added CFBundleIconFiles in Info.plist.
- Upgraded project to build with the iOS 4.0 SDK.
- Enhanced the accessibility of the app by effectively using the iPhone Accessibility API.
- Rewrote the GraphView class to drastically improve performance. Implementation is considerably different from previous versions.
- Refactored to use a view controller rather than doing similar work in the AppDelegate.
- Refactored to separate filters from display.
- Can now select either a low-pass or high-pass filter.
- Can now set the filter for an adaptive mode that causes the filter to converge to the new output value much faster
- Updated for and tested with iPhone OS 2.0. First public release.
- Simplified updating of drawing by eliminating the NSTimer previously used to mark the view as needing to be redrawn. In this new version, the view is marked whenever new data arrives from the accelerometer.
- Now use fixed-width buttons in UI.
- Modified update frequency to smooth animations.
- Removed underscore prefixes on ivars to match sample code guidelines.
- Updated for Beta 6.
- Updated for Beta 5.
- Updated build settings.
- Updated ReadMe file and converted it to plain text format for viewing on website.
- Updated ReadMe file.
- Added an icon and a default.png file.
Copyright (C) 2008-2010 Apple Inc. All rights reserved.
© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-06-28)