/// <summary> /// Creates an instance. /// </summary> public BarometerTestUIModel(TaskFactory uiThread) : base(uiThread) { // Initialize members OsrList = new List<int>(Enum.GetValues(typeof(Ms5611Osr)).Cast<int>()); Graph = new List<Ms5611Measurement>(); // Initialize device Device = new NavioBarometerDevice(); Device.MeasurementUpdated += OnMeasurementUpdated; }
/// <summary> /// Executes the task. /// </summary> public void Run(IBackgroundTaskInstance taskInstance) { using (var barometer = new NavioBarometerDevice()) { barometer.Reset(); while (true) { barometer.Update(); Debug.WriteLine(barometer.Measurement); } } }