Beispiel #1
0
        private static async void Connect_ADC()
        {
            // when the connect button is clicked update the ADC i2c addresses with the values in the textboxes on the page
            try
            {
                adc.Address1 = Convert.ToByte("68", 16);
                adc.Address2 = Convert.ToByte("69", 16);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            // create a Connected event handler and connect to the ADC Pi.
            adc.Connected += Adc_Connected;
            await adc.Connect();
        }
 private void Adc_Connect()
 {
     // Connect to the ADC Pi and wait for the Connected event
     adc.Connected += Adc_Connected;
     adc.Connect();
 }