Ejemplo n.º 1
0
        private async void InitThings()
        {
            hat = await Emmellsoft.IoT.Rpi.SenseHat.SenseHatFactory.GetSenseHat();

            await device.OpenAsync();

            hat.Display.Fill(Windows.UI.Colors.Navy);
            hat.Display.Update();

            timer.Start();
        }
        private async void buttonOpen_Click(object sender, RoutedEventArgs e)
        {
            deviceClient = Microsoft.Azure.Devices.Client.DeviceClient.CreateFromConnectionString(tbConnectionString.Text, Microsoft.Azure.Devices.Client.TransportType.Amqp);
            try
            {
                await deviceClient.OpenAsync();

                tbMessage.Text = "Connected";
                ReceiveC2DMessages();
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Exception : " + ex.Message);
            }
        }