Main Site Documentation

Switch pin mode


#1

How do I set an InputPort pin to become an OutputPort pin, and vice versa?
Or if that isn’t possible, how can I simply reset a pin so that I can create a new InputPort object using it?


#2

Look at the TristatePort:

http://msdn.microsoft.com/en-us/library/ee436884.aspx


#3

And some code: http://www.tinyclr.com/forum/2/3549/


#4

Is this for RLP, ie C/C++?

For RLP, if you include RLP.h then you can call:

RLPext->GPIO.EnableOutputMode(Pin,0);

or

RLPext->GPIO.EnableInputMode(Pin,RLP_GPIO_RESISTOR_DISABLED);