sud.startAccelerometer
JS
sud.startAccelerometer(Object object)Starts listening for accelerometer data.
Parameters
- Object object: Input parameters, see the table below for details
Properties of object:
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| interval | string | normal | No | Execution interval of the accelerometer data callback function |
| type | string | accelerationIncludingGravity | No | Whether gravity is included. accelerationIncludingGravity includes gravity, acceleration excludes gravity |
| success | function | No | Callback function for a successful interface call | |
| fail | function | No | Callback function for a failed interface call | |
| complete | function | No | Callback function for the completion of the interface call |
Valid values of interval:
| Value | Description |
|---|---|
| game | Suitable for game update callback frequency, around 20ms/time |
| ui | Suitable for UI update callback frequency, around 60ms/time |
| normal | Normal callback frequency, around 200ms/time |
