my.startGyroscope
Use this JSAPI to start listening to gyroscope data. The callback interval is 500ms. After the interface is called, the listening is automatically started. You can call the my.stopGyroscope JSAPI to stop listening.
Sample Code
my.startGyroscope({
interval: 'ui',
success: function(res) {
console.log(res);
},
fail: function(err) {
console.log(err);
}
});
Parameters
The incoming parameter is of the Object type with the following properties:
Property | Type | Required | Description |
interval | String | No | The frequency of the callback function that listens to the gyroscope data. Valid value:
|
success | Function | No | The callback function that is called upon successful call. |
fail | Function | No | The callback function that is called when the JSAPI call fails. When executed, it receives an |
complete | Function | No | The callback function that is called upon call completion (to be executed upon either successful or failed call). |
err
object
Parameter | Data type | Required | Description |
error | Number | Yes | An error code that represents the specific error encountered. |
errorMessage | String | Yes | An error message that describes the corresponding error code. |