Retrieving the gyroscope status
This snippet retrieves the gyroscope status and gives its read outs in 3 axis.
var gyroX, gyroY, gyroZ;
window.addEventListener("deviceorientation", function(e) {
gyroX = e.alpha;
gyroY = e.beta;
gyroZ = e.gamma;
});