PICO GP IO Internal weak Pull UP Down

Use this section to discuss your embedded Flowcode projects.
Post Reply
jay_dee
Posts: 135
http://meble-kuchenne.info.pl
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 47 times
Been thanked: 31 times

PICO GP IO Internal weak Pull UP Down

Post 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.

LeighM
Valued Contributor
Posts: 401
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 73 times
Been thanked: 218 times

Re: PICO GP IO Internal weak Pull UP Down

Post 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.

jay_dee
Posts: 135
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 47 times
Been thanked: 31 times

Re: PICO GP IO Internal weak Pull UP Down

Post 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 6 times
J.

Post Reply