Initialize() public method

public Initialize ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
Esempio n. 1
0
        protected override async void OnNavigatedTo(NavigationEventArgs navArgs)
        {
            MakePinWebAPICall();

            try
            {
                //Create a new object for the color sensor class
                colorSensor = new TCS34725();
                //Initialize the sensor
                await colorSensor.Initialize();

                //Create a new SpeechSynthesizer
                synthesizer = new SpeechSynthesizer();

                //Create a new MediaElement
                audio = new MediaElement();

                //Initialize the GPIO pin for the pushbutton
                InitializeGpio();
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
            }
        }
        protected override async void OnNavigatedTo(NavigationEventArgs navArgs)
        {
            MakePinWebAPICall();

            try
            {
                //Create a new object for the color sensor class
                colorSensor = new TCS34725();
                //Initialize the sensor
                await colorSensor.Initialize();

                //Create a new SpeechSynthesizer
                synthesizer = new SpeechSynthesizer();

                //Create a new MediaElement
                audio = new MediaElement();

                //Initialize the GPIO pin for the pushbutton
                InitializeGpio();
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
            }
        }