Magnetometer class
TOC
Collapse the table of content
Expand the table of content

Magnetometer class

Represents a magnetic sensor.

Syntax


var magnetometer = Windows.Devices.Sensors.Magnetometer;

Members

The Magnetometer class has these types of members:

Events

The Magnetometer class has these events.

EventDescription
ReadingChanged Occurs each time the compass reports a new sensor reading.

 

Methods

The Magnetometer class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
GetCurrentReading Gets the current magnetometer reading.
GetDefault Returns the default magnetometer.

 

Properties

The Magnetometer class has these properties.

PropertyAccess typeDescription

DeviceId

Read-only

Gets the device identifier.

MinimumReportInterval

Read-only

Gets the minimum report interval supported by the magnetometer.

ReadingTransform

Read/write

Gets or sets the transformation that needs to be applied to sensor data. Transformations to be applied are tied to the display orientation with which to align the sensor data.

ReportInterval

Read/write

Gets or sets the current report interval for the magnetometer.

 

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Devices.Sensors
Windows::Devices::Sensors [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

None supported

Minimum supported server

None supported

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Devices.Sensors
Windows::Devices::Sensors [C++]

Metadata

Windows.winmd

Attributes

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version]

See also

Object

 

 

Show:
© 2016 Microsoft