sud.onCompassChange
JS
sud.onCompassChange(function callback)Listens for compass data change events.
Interval: 5 times/second. Listening starts automatically after the interface is called, and can be stopped with sud.stopCompass.
Parameters
- function callback: Callback function for compass data change events
Parameters of the callback function
- Object res: Returns compass data
Properties of the compass data:
| Property | Type | Description |
|---|---|---|
| direction | number | Degrees of the facing direction |
| accuracy | number/string | Accuracy |
