I am facing exact same problem as asked here in this question. It's basically the "reading floating values" problem when pull-down resistors are not used.

I am unable to activate pull-down resistors through C# code.I tried various GpioPinDriveMode input modes and the following code, but none of them solved my problem. I still got random inputs from the GPIO pin.


Is this the wrong way to activate pull-down resistors? How do I do that?

Note that the problem is solved when I physically add a resistor in series. However I would like to use the inbuilt pull-down resistors available in R'pi.

1 Answer 1


Solved. I made a silly mistake on my part. Visual studio was running my old source even after I rebuilt then deployed it. I had to clean my solution and then run it, and It turned out to be Okay!


This line is definitely the correct way to activate pull-down resistors using C#.

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.