title: How can I set raspberry pi GPIO output to high impedance?
body: <p>I am using RPi.GPIO Raspberry Pi GPIO library.</p>
  <p>I know how to set an output to high or low, but i need to set it as high impedance.</p>
  <pre><code>GPIO.output(PIN, GPIO.HIGH)  # or GPIO.LOW
  </code></pre>
  <p>Is there a way to set the output as &quot;high impedance&quot;, something like:</p>
  <pre><code>GPIO.output(PIN, GPIO.FLOAT)
  </code></pre>
  <p>so that the output is floating and constrained by surrounding circuitry only? (like the drain or collector of a MOS or BJT)?</p>
  <p>A possible way would be switch the pin mode to input and set pull up/down resistors to no pullup or pull down, is this the only way, or there is a better solution?</p>