Teslameter
| Last Revision: | |
| Build Requirements: | iOS SDK 4.0 |
| Runtime Requirements: | iPhone OS 3.2 or later and iPhone 3GS or iPhone 4
Requires a device with a magnetometer. This sample will run in the Simulator but only one magnetic measurement will be received. |
This application implements a Teslameter, a magnetic field detector. It displays the raw x, y, and z magnetometer values, a plotted history of those values, and a computed magnitude (size or strength) of the magnetic field.
The use of the Core Location API for getting "heading" data is contained in the TeslameterViewController class. It creates a CLLocationManager object and uses it to get heading by invoking -[CLLocationManager startUpdatingHeading]. It implements the CLLocationManagerDelegate APIs for receiving heading and updates its user interface accordingly.
© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-06-28)