startGyroscope 陀螺仪监听
startGyroscope ^6.8
陀螺仪监听
#请求参数
- N/A
#引入接口模块
import bridge from '@minix-iot/etsbridge-sdk'
#接口调用示例
bridge
.startGyroscope()
.then((res) => {
console.log(res)
})
.catch((err) => {
console.log(err)
})
#返回参数
- 成功时返回
| Prop | Type | Comment |
|---|---|---|
code |
Number |
0 |
x |
Number |
x 轴的角速度 |
y |
Number |
y 轴的角速度 |
z |
Number |
z 轴的角速度 |
- 失败时返回(api 为空或者没有)
| Prop | Type | Value |
|---|---|---|
code |
Number |
-1 |
msg |
String |
失败 |
| Prop | Type | Value |
|---|---|---|
code |
Number |
-8 |
msg |
String |
不支持 |
#返回示例
{
"code": 0,
"x": 0.2082139253616333,
"y": 0.107050821185112,
"z": 0.04517493396997452
}
浙公网安备 33010602011771号