每次我打开一个GPIO引脚时,我都会得到这个异常:
WinRT information: Failed to open a handle to the device.
A resource required for this operation is disabled.
我在互联网上找不到很多关于这个的信息。可能是因为UAP仍处于预览阶段。而且我认为我的代码没有问题,它几乎与Blink示例中的代码相同:
GpioController gpio = GpioController.GetDefault();
if (gpio != null)
{
var ledpin = gpio.OpenPin(11);
ledpin.Write(_light ? GpioPinValue.High : GpioPinValue.Low);
ledpin.SetDriveMode(GpioPinDriveMode.Output);
}