Esempio n. 1
0
        /* Initialize GPIO, SPI, and the display */
        private async void InitAll()
        {
            Display_TextBoxLine0.IsEnabled = false;
            Display_TextBoxLine1.IsEnabled = false;
            Display_TextBoxLine2.IsEnabled = false;
            Display_TextBoxLine3.IsEnabled = false;

            await ssd1306.InitAll();

            Display_TextBoxLine0.IsEnabled = true;
            Display_TextBoxLine1.IsEnabled = true;
            Display_TextBoxLine2.IsEnabled = true;
            Display_TextBoxLine3.IsEnabled = true;

            /* Register a handler so we update the SPI display anytime the user edits a textbox */
            Display_TextBoxLine0.TextChanged += Display_TextBox_TextChanged;
            Display_TextBoxLine1.TextChanged += Display_TextBox_TextChanged;
            Display_TextBoxLine2.TextChanged += Display_TextBox_TextChanged;
            Display_TextBoxLine3.TextChanged += Display_TextBox_TextChanged;

            /* Manually update the display once after initialization*/
            DisplayTextBoxContents();

            Text_Status.Text = "Status: Initialized";
        }