0

I am trying to just use a small program to make sure I have everything setup correctly. However, I am getting errors (see comments) for everything that is referencing "GPIO" Also, I have already referenced the "Windows IoT Extensions for UWP". - Thank you and any help is greatly appreciated!

Imports Windows.Devices.Gpio  'Imports statement is unnecessary

Public NotInheritable Class MainPage
Inherits Page
Private gpio
Private pin As GpioPin 'ERROR: GpioPin is not defined
Private Const LED_PIN = 18

Private Sub button_Click(sender As Object, e As RoutedEventArgs) Handles button.Click
    Call TurnLedOnOff()
End Sub

Private Sub TurnLedOnOff()

        'Check if gpio was already initialied
        If gpio Is Nothing Then
            gpio = GpioController.GetDefault 'ERROR: GpioController is not declared 
        End If

        'Check if LED's pin was already initialied
        If pin Is Nothing Then
            pin = gpio.OpenPin(LED_PIN)
            pin.Write(GpioPinValue.Low) 'ERROR: Not Declared
            pin.SetDriveMode(GpioPinDriveMode.Output) 'ERROR: Not Declared
        End If

        'Read pin status and invert state
        If pin.Read = GpioPinValue.High Then 'ERROR: Not Declared
            pin.Write(GpioPinValue.Low) 'ERROR: Not Declared
        Else
            pin.Write(GpioPinValue.High) 'ERROR: Not Declared
        End If
    End Sub
End Class

1 Answer 1

1

So, the solution was fairly simple. Uninstall Visual Studio and SDK. Then, upon reinstalling be sure to install Windows SDK: Version 10586.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.