值
一個 Number。
示例
陀螺儀通常在 reading 事件回撥中讀取。在下面的示例中,這每秒發生六十次。
js
let gyroscope = new Gyroscope({ frequency: 60 });
gyroscope.addEventListener("reading", (e) => {
console.log(`Angular velocity along the X-axis ${gyroscope.x}`);
console.log(`Angular velocity along the Y-axis ${gyroscope.y}`);
console.log(`Angular velocity along the Z-axis ${gyroscope.z}`);
});
gyroscope.start();
規範
| 規範 |
|---|
| Gyroscope # gyroscope-y |
瀏覽器相容性
載入中…