Starting GPIO pins

In the following part of the code written in C#, we need to initialize the out-pins and manage them to control them:

using Windows.Devices.Gpio;
private void InitGPIO()
{
var gpio = GpioController.GetDefault();
// Show an error if there is no GPIO controller
if (gpio == null) {
pin = null;
GpioStatus.Text = "There is no GPIO controller on this device."; return;
}
pin = gpio.OpenPin(LED_PIN);
pinValue = GpioPinValue.High;
pin.Write(pinValue);
pin.SetDriveMode(GpioPinDriveMode.Output);
GpioStatus.Text = "GPIO pin initialized correctly.";
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.120.109