private async void DeviceIOSet_Click_1(object sender, RoutedEventArgs e) { var fx2Device = DeviceList.Current.GetSelectedDevice(); if (fx2Device == null) { rootPage.NotifyUser("Fx2 device not connected or accessible", NotifyType.ErrorMessage); return; } byte val = (byte)(DeviceIOSegmentInput.SelectedIndex + 1); byte[] input = new byte[] { Fx2Driver.DigitToSevenSegment(val) }; try { await fx2Device.SendIOControlAsync( Fx2Driver.SetSevenSegmentDisplay, input.AsBuffer(), null ); rootPage.NotifyUser("The segement display is set to " + val, NotifyType.StatusMessage); } catch (Exception exception) { rootPage.NotifyUser(exception.Message, NotifyType.ErrorMessage); } }