Failed to open device handle when opening GPIO output

Every time I open the GPIO output, I get this exception:

WinRT information: Failed to open a handle to the device. A resource required for this operation is disabled. 

I can not find much information for this on the Internet. Probably because UAP is still in preview. And I don’t think that something is wrong with my code, it is almost the same from the Blink example:

 GpioController gpio = GpioController.GetDefault(); if (gpio != null) { var ledpin = gpio.OpenPin(11); ledpin.Write(_light ? GpioPinValue.High : GpioPinValue.Low); ledpin.SetDriveMode(GpioPinDriveMode.Output); } 
+8
c # win-universal-app raspberry-pi2 windows-10-iot-core
source share
1 answer

For usermode, only a subset of contacts is available. Most contacts are reserved by the system and cannot be accessed from usermode.

As far as I know, pin 11 is not available. Try to set pin 12 or 13.

List of available contacts:

 GPIO# Power-on Pull Header Pin 4 PullUp 7 5 PullUp 29 6 PullUp 31 12 PullDown 32 13 PullDown 33 16 PullDown 36 17 PullDown 11 18 PullDown 12 19 PullDown 35 20 PullDown 38 21 PullDown 40 22 PullDown 15 23 PullDown 16 24 PullDown 18 25 PullDown 22 26 PullDown 37 27 PullDown 13 35 PullUp Red Power LED 47 PullUp Green Activity LED 

Pi2 layout

Edit: added missing GPIOs

+9
source share

All Articles