Replies: 2 comments 3 replies
-
You have to use repr(pin1) if pin1 is the pin object and extract the info from the returned string. |
Beta Was this translation helpful? Give feedback.
-
Hi @rkompass and thank you for your feedback. And default uart for example, I have a format in output (without the pins though): >> u = UART(0)
>> repr(u)
"UART(0, baudrate=115201, bits=8, parity=None, stop=1, tx=-1, rx=-1, rts=-1, cts=-1, txbuf=256, rxbuf=256, timeout=0, timeout_char=0)" This is the kind of return that would be nice with the pins :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello to all!
I haven't found any way to know the current state of configuration of the pins.
Without disturbing a pin, the fact of declaring it without any arguments allows to access it easily:
Pin(n)
So we can know its high/low state.
But if we want to know its minimal configuration such as its IN/OUT or PULL state, how can we do it from MicroPython on ESP32 ?
I remember that Daniel Compora allowed this in the Pycom versions at the time.
( a special call on the pin returned a tuple of the configuration with IN/OUT, PULL UP/DOWN/None etc...)
I ask, but maybe this has already been proposed and refused because of compatibility concerns between ports or with Espressif's low-level APIs...
Thanks to all the team anyway! 👍🏻
Beta Was this translation helpful? Give feedback.
All reactions