Added GravitySensor demo
This commit is contained in:
23
standalone/imu-1/t1.html
Normal file
23
standalone/imu-1/t1.html
Normal 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>
|
||||
Reference in New Issue
Block a user