universal-accelerometer
Accelerometer monitor and cancel.
Support
Install
$ npm install universal-accelerometer --save
Methods
onChange(callback): void
Monitoring acceleration data, the callback interval is 500ms, the interface calls will automatically start listening, can use offChange() to stop listening.
Parameters
Property | Type | Description | Support |
---|---|---|---|
callback | Function |
The callback function |
offChange(): void
Stop listening for acceleration data.
Example
; Accelerometer; Accelerometer;