From the book
Gyrometer
Gyrometer
The gyrometer sensor provides information about angular velocity or how the device is being rotated. Like the other sensors, it provides an API to obtain the current reading as well as an event that fires when the reading changes. Listing 4.7 shows how to interpret the results from that event.
Listing 4.7: Reading the Gyrometer
async private void ReadingChanged(object sender, GyrometerReadingChangedEventArgs e) { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { GyrometerReading reading = e.Reading; ScenarioOutput_X.Text = String.Format("{0,5:0.00}", reading.AngularVelocityX); ScenarioOutput_Y.Text = String.Format("{0,5:0.00}", reading.AngularVelocityY); ScenarioOutput_Z.Text = String.Format("{0,5:0.00}", reading.AngularVelocityZ); }); }
You can learn more about the gyrometer online at http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.sensors.gyrometer.aspx.