CompassReading CompassReading CompassReading Class

Definition

Represents a compass reading.

public sealed class CompassReading : ICompassReading, ICompassReadingHeadingAccuracypublic sealed class CompassReading : ICompassReading, ICompassReadingHeadingAccuracyPublic NotInheritable Class CompassReading Implements ICompassReading, ICompassReadingHeadingAccuracy
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This object is accessed when you invoke the GetCurrentReading method; and, it is accessed when you retrieve the Reading property of the CompassReadingChangedEventArgs object in the event callback method.

Properties

HeadingAccuracy HeadingAccuracy HeadingAccuracy

Gets the compass's heading accuracy.

public MagnetometerAccuracy HeadingAccuracy { get; }public MagnetometerAccuracy HeadingAccuracy { get; }Public ReadOnly Property HeadingAccuracy As MagnetometerAccuracy
Value
MagnetometerAccuracy MagnetometerAccuracy MagnetometerAccuracy

The compass's heading accuracy.

Attributes

HeadingMagneticNorth HeadingMagneticNorth HeadingMagneticNorth

Gets the heading in degrees relative to magnetic-north.

public double HeadingMagneticNorth { get; }public double HeadingMagneticNorth { get; }Public ReadOnly Property HeadingMagneticNorth As double
Value
double double double

The magnetic-north heading.

Attributes

HeadingTrueNorth HeadingTrueNorth HeadingTrueNorth

Gets the heading in degrees relative to geographic true-north.

public IReference<double> HeadingTrueNorth { get; }public IReference<double> HeadingTrueNorth { get; }Public ReadOnly Property HeadingTrueNorth As IReference<double>
Value

The true-north heading.

Attributes

Remarks

Before retrieving this property, your code should first check to verify that the value is not null. (If the value is null and you attempt to retrieve it, Windows will generate an exception.)

In order to retrieve the declination, your app needs to have access to the device's current location. If the location is not available, the declination defaults to 0 degrees. In this scenario, HeadingTrueNorth equals HeadingMagneticNorth.

Timestamp Timestamp Timestamp

Gets the time at which the sensor reported the reading.

public DateTime Timestamp { get; }public DateTimeOffset Timestamp { get; }Public ReadOnly Property Timestamp As DateTimeOffset
Value
DateTime DateTime DateTime

The time at which the sensor reported the reading.

Attributes

See Also