Inspecting the gyroscope sensor

You can test the app here: http://mztests.herokuapp.com/rotation/

The different is just change to listen to deviceorientation and use e.alpha, e.beta, e.gamma for the rotation axises.

1window.addEventListener('deviceorientation', function (e) {
2  app.xValues.push(e.alpha);
3  app.yValues.push(e.beta);
4  app.zValues.push(e.gamma);
5  ...
6}

What’s next? We’re going to take a look at “Project 12 – Distribution Channels”.

overlaied image when clicked on thumbnail

Makzan | Mobile web app dev with phonegap | Table of Content