O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sensing Rotation with the Gyroscope

The gyroscope is an optional hardware sensor that can sense rotation. Although the accelerometer is able to gauge the orientation of the phone when it is stationary, it is not able to sense rotation. If the device is in free fall, the accelerometer reading is theoretically zero. In contrast, the gyroscope measures the rate of rotation around a particular axis, so that while the device continues to be in rotation the reading is non-zero. The disadvantage, however, is that because the gyroscope measures rotational velocity, and not position, it is subject to drift.

The sample code for this section creates a page that displays raw readings from the gyroscope, as well as providing a visual representation of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required