Skip to main content

bn.onCompassChange

onCompassChange(cb): void

description Monitor compass data changes. Frequency: 5 second/Seconds, the interface will automatically start listening after the call, you can use the bn.stopCompass Stop listening.

example

 bn.onCompassChange(callback)

Parameters

NameType
cbOnCompassChangeCallback

Returns

void


OnCompassChangeCallback

Ƭ OnCompassChangeCallback: (result: OnCompassChangeCallbackResult) => void

Type declaration

▸ (result): void

Callback function for compass data change events

Parameters

NameType
resultOnCompassChangeCallbackResult

Returns

void


Interface: OnCompassChangeCallbackResult

NameTypeDescription
accuracystring | numberaccuracy
directionnumberDegree of direction faced