Not TestedTesting not done, may not work properly
Device & Sensors

Device Motion

Measure device acceleration and rate of rotation along 3 axes.

Checking support...
Advertisement

Interactive Input Workspace

Ready for input

Web API Execution Output

Result output will be displayed here after processing...

Native JavaScript Code Example (Zero Libraries)

window.addEventListener('devicemotion', (e) => {
  console.log(e.acceleration.x);
});

About the Device Motion Web API

DeviceMotionEvent gives information about the speed of acceleration and rotation.

Specification:W3C & WHATWG Web API Standard
Sponsored Content