Page 1 of 1

PICO GP IO Internal weak Pull UP Down

Posted: Fri Apr 26, 2024 2:10 pm
by jay_dee
Hi,
Playing with the PICO and its working well.
If I want a single pin (GP5) to be a input and set a weak pull up or pul down, how would I do this?
Does it need a line of C code?
I have a Switch component setup, set for Active Low. So I assume the Pin will be correctly set as an input.
Thanks, J.

Re: PICO GP IO Internal weak Pull UP Down

Posted: Fri Apr 26, 2024 4:25 pm
by LeighM
Try this C code

Code: Select all

gpio_pull_up(5);
It might need to be placed after a Switch Read macro, which will initialise the pin for input.

Re: PICO GP IO Internal weak Pull UP Down

Posted: Fri Apr 26, 2024 5:11 pm
by jay_dee
Hi,
Thanks, yep that works great.
Also found the pull down and pull disable (leave pin floating) commands.
test program attached for anyone else wanting to play along.
Also checked and the pull up is weak at around ~50K but works for my needs
IO_Pull_UPs_Enable.fcfx
(12.37 KiB) Downloaded 244 times
J.