Using the Gyroscope Sensor
The gyroscope sensor is not a required component of Windows Phone devices. It is therefore important to verify that it is supported before attempting to use it. For this, the static
Gyroscope.IsSupported property is used, as demonstrated in the
GyroscopeViewModel class (see Listing 16.9). The
Start method of the
GyroscopeViewModel oversees the creation of the
The default value of the
TimeBetweenUpdates property is 20 milliseconds, which on my test device was the minimum allowed value.
As with all sensor types, the
CurrentValueChanged event is used to receive periodic updates from the sensor.
public void Start() ...