Pebble.Compass

Read compass heading from watches with a magnetometer.

Native Pebble C API

Union Types

Error

type Error
    = Unavailable
    | InvalidReading

Compass errors returned at the app boundary.

Type Aliases

Heading

type alias Heading =
    { degrees : Float
    , isValid : Bool
    }

A compass heading in degrees (0–360) when valid.

Commands

current

current : (Result Error Heading -> msg) -> Cmd msg

Request the current heading once.

Subscriptions

onChange

onChange : (Heading -> msg) -> Sub msg

Receive heading updates when the compass service reports changes.