PIO Pull up, Pull down, none #11329
Unanswered
LordStress
asked this question in
RP2040 / Pico
Replies: 1 comment 2 replies
-
How about: pin_list = [Pin(n, Pin.IN, Pin.PULL_UP) for n in range(2,7+1)] That way you can refer to them later-on. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Firstly I hope I am in the right place as I came across from MicroPython Forum (Archive)] (http://forum.micropython.org/)
Anyhow, I am using the PIO on the pico to read a 6 bit rotary encoder. After a bit of reading and experimenting I deduced that e the GPIO pins seem to default to no internal pullup resistors being enabled. So I needed to enable them explicitly for each of the 6 pins. As in:
My question: Is there a more concise way of setting multiple PULL_UP resistors for multiple pins, other than doing them one at a time like my test program.
I also found that whereas the Pin.PULL_UP and Pin.PULL_DOWN are implemented for the RP2040 in MicroPython, the Pin.PULL_NONE is missing, although an absence of the PULL_UP/DOWN argument seems to default the pin PULL_NONE state.
** I edited the post as one of the lines of code had a bug in it.
Beta Was this translation helpful? Give feedback.
All reactions