# wx.onGyroscopeChange(function callback)
Start from base library version 2.3.0. Please remaining backward compatible.
Listens on the gyroscope data change event. The frequency is based on the wx.startGyroscope() interval parameter. You can use wx.stopGyroscope() to stop listening.
# Parameters
# function callback
The callback function for the gyroscope data change event.
# Parameters
# Object res
Property | Type | Description |
---|---|---|
res | Object |
res is composed as follows
Property | Type | Description |
---|---|---|
x | number | X-axis angular velocity |
y | number | Y-axis angular velocity |
z | number | Z-axis angular velocity |