May 19, 2021 WeChat Mini Program Development Document
The base library 2.3.0 starts to support, and the lower version needs to be compatible.
Stop listening to gyroscope data.
Property | Type | The default | Required | Description |
---|---|---|---|---|
success | function | Whether | The interface calls a successful callback function | |
fail | function | Whether | The interface calls the failed callback function | |
complete | function | Whether | Callback function at end of interface call (call succeeds, fails are executed) |
The base library 2.3.0 starts to support, and the lower version needs to be compatible.
Start listening for gyroscope data.
Property | Type | The default | Required | Description |
---|---|---|---|---|
interval | string | normal | Whether | The frequency at which the gyroscope data callback function is executed |
success | function | Whether | The interface calls a successful callback function | |
fail | function | Whether | The interface calls the failed callback function | |
complete | function | Whether | Callback function at end of interface call (call succeeds, fails are executed) |
The legal value of object.interval
Value | Description | The lowest version |
---|---|---|
game | Callback frequency for updating games, around 20ms/time | |
Ui | Callback frequency for updating the UI, around 60ms/time | |
normal | Normal callback frequency, around 200ms/time |
The base library 2.3.0 starts to support, and the lower version needs to be compatible.
Listen for gyroscope data change events. T he frequency is based on the interval parameter of wx.startGyroscope(). You can use wx.stopGyroscope() to stop listening.
Tune function of gyro data change event
Property | Type | Description |
---|---|---|
Ⅹ | number | The adverb speed of the x-axis |
Y | number | The adverb speed of the y-axis |
Z | number | The adverb speed of the z-axis |
Base Library 2.9.3 starts to support, and low versions need to be compatible.
Cancel listening for gyroscope data change events.
The callback function for gyroscope data change events