Select C#–> Windows Universal template
In the next screen select target version.We will select past version since that is more stable:
In the new project select the reference node and right click
In the references window select Windows IoT Extensions for the UWP
After you add the reference ,it is visible in the references tab:
By default MainPage.xaml is added in the project.We can UI elements to the page from the toolbox(Ctrl+Alt+X).Select View–>Toolbox to select the toolbox:
We will add a textblock and button on the Page.
In the button click we will add simple logic to check if GPIO controller is present in the device.
private void Button_Click(object sender, RoutedEventArgs e) { var gpio = GpioController.GetDefault(); if (gpio == null) { txtGPIOStatus.Text = "There is no GPIO controller on this device."; return; } else { txtGPIOStatus.Text = "There is GPIO controller in the device,you can use the GPIO pins. "; } }
Now you are ready to deploy your application to the remote IoT device.In the drop down select Remote Machine.
Right click the project and select deploy to deploy your application:
Leave a Reply