Added GravitySensor demo

This commit is contained in:
2025-09-17 17:59:06 +02:00
parent e664440360
commit 322d268de4
3 changed files with 229 additions and 0 deletions

23
standalone/imu-1/t1.html Normal file
View File

@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>Accelerometer test</title>
</head>
<script>
const acl = new GravitySensor({ frequency: 60 });
acl.addEventListener("reading", () => {
document.body.innerHTML = `<pre>
Acceleration along the X-axis ${acl.x}
Acceleration along the Y-axis ${acl.y}
Acceleration along the Z-axis ${acl.z}
</pre>`;
});
acl.start();
</script>
<body>
</body>
</html>