Gyroscope: y プロパティ
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Gyroscope
インターフェイスの読み取り専用プロパティ y
は、デバイスの y 軸方向の角速度を表す数値を返します。
値
Number
です。
例
ジャイロスコープは、通常 reading
イベントコールバックで読み取られます。以下の例では、これを 1 秒に 60 回行います。
js
let gyroscope = new Gyroscope({ frequency: 60 });
gyroscope.addEventListener("reading", (e) => {
console.log(`X 軸方向の角速度 ${gyroscope.x}`);
console.log(`Y 軸方向の角速度 ${gyroscope.y}`);
console.log(`Z 軸方向の角速度 ${gyroscope.z}`);
});
gyroscope.start();
仕様書
Specification |
---|
Gyroscope # gyroscope-y |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
y |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.