3 ms·
The accelerometer interaction hooks into javascript via browser events. Here's the basic usage for chrome: (for firefox the event is MozOrientation, and values
by willscott 16y ago
The accelerometer interaction hooks into javascript via browser events.
Here's the basic usage for chrome: (for firefox the event is MozOrientation, and values are radians rather than degrees)
window.addEventListener('deviceorientation', function(evt) {
var x = evt.gamma, y = evt.beta;
}, false);