Compass

The compass sensor follows the same pattern as the others. The Compass class has identical members to Inclinometer and Gyrometer, except the readings returned are of type CompassReading. CompassReading exposes three properties:

HeadingMagneticNorth—A double representing the magnetic-north heading in degrees.

HeadingTrueNorth—A nullable double representing the true-north heading in degrees. This can’t always be determined, so the property is null in such cases.

Timestamp—The date and time that the measurement was taken; a DateTimeOffset, like all the other Timestamp properties.

Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.