Compass​Reading Compass​Reading Compass​Reading Class


Represents a compass reading.

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


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.


HeadingAccuracy HeadingAccuracy HeadingAccuracy

Gets the compass's heading accuracy.

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

The compass's heading accuracy.


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
double double double

The magnetic-north heading.


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>

The true-north heading.



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
DateTime DateTime DateTime

The time at which the sensor reported the reading.


See Also