Hi Sara, et all,
Can I change an ESP8266 pin dynamically (MicroPython)
Any code examples appreciated.
Gary
6 Answers
In a python script can I set a a GPIO as output then ie to set a pin high, and then imedially after set the same pin back to input?
This would be like a
Tri-state
Hi.
Yes, I think you can do that.
Check the documentation here: https://docs.micropython.org/en/latest/library/machine.Pin.html
See the example “usage model” and take a look at p0 that is first declared as an output, and then it is changed to an input.
Regards,
Sara
Thanks looks good – from your ref:
-
Pin.OPEN_DRAIN
– If the value is ‘0’ the pin is set to a low voltage state. Otherwise the pin is set to high-impedance state.