/// <summary> /// Starts this instance. /// </summary> partial void Start() { _gyroscope = new Microsoft.Devices.Sensors.Gyroscope { TimeBetweenUpdates = TimeSpan.FromMilliseconds((long)Interval) }; _gyroscope.CurrentValueChanged += GyroscopeCurrentValueChanged; _gyroscope.Start(); }
public Gyroscope(TimeSpan updateInterval) { if (this.IsSupported) { this.gyroscope = new Microsoft.Devices.Sensors.Gyroscope() { TimeBetweenUpdates = updateInterval }; this.gyroscope.CurrentValueChanged += gyroscope_CurrentValueChanged; } }
/// <summary> /// Stops this instance. /// </summary> partial void Stop() { _gyroscope.CurrentValueChanged -= GyroscopeCurrentValueChanged; _gyroscope.Stop(); _gyroscope = null; }