March 2018
Beginner to intermediate
410 pages
10h 40m
English
Once we have access to the controller, we can try to open exclusive access to the GPIO pin we've connected the relay to:
if (gpio.TryOpenPin(gpioOutputPin, GpioSharingMode.Exclusive,
out this.gpioPin, out GpioOpenStatus Status) &&
Status == GpioOpenStatus.PinOpened)
{
...
}
else
Log.Error("Unable to get access to GPIO pin " +
gpioOutputPin.ToString());
Through the GpioPin object gpioPin, we can now control the pin. The first step is to set the operating mode for the pin. This is done by calling the SetDriveMode() method. There are many different modes a pin can be set to, not all necessarily supported by the underlying firmware and hardware. To check that a mode is supported, call the IsDriveModeSupported() ...
Read now
Unlock full access