Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4983

MicroPython • Re: PULL_UP PULL_DOWN State is back to front?

$
0
0
No, it's not Pin.Pull_UP. You have the button wired between the GPIO and 3.3V. Therefore you want Pin.PULL_DOWN.

In the resting state the button is not pressed, so you want the GPIO pulled to ground (therefore, pull down). The GPIO state reads low.

When you push the button the GPIO is connected to 3.3V, which is stronger than the pull-down, so the GPIO state reads high.

Thank you, I was thinking about it the wrong way.

Statistics: Posted by benpaddlejones — Fri Jan 24, 2025 5:42 am



Viewing all articles
Browse latest Browse all 4983

Trending Articles