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 / notebook
Gyroscope
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.