# Can't get input button to work

**URL:** https://forum.core-electronics.com.au/t/cant-get-input-button-to-work/17624
**Category:** Micropython
**Created:** [19 July 2023 08:50 UTC](https://forum.core-electronics.com.au/t/cant-get-input-button-to-work/17624 "2023-07-19T08:50:26Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Glenn195541](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/glenn195541/32/8705_2.png) [@Glenn195541](https://forum.core-electronics.com.au/u/Glenn195541)
#### Post date: [19 July 2023 08:50 UTC](https://forum.core-electronics.com.au/t/cant-get-input-button-to-work/17624/1 "2023-07-19T08:50:26Z")

</div>

I have set up a simple circuit from [https://projects.raspberrypi.org/en/projects/getting-started-with-the-pico/6](https://projects.raspberrypi.org/en/projects/getting-started-with-the-pico/6), but the button won’t work. The previous exercise with the LED was fine.

Thanks.

---

<div class="post-metadata">

### Author: ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)
#### Post date: [19 July 2023 09:36 UTC](https://forum.core-electronics.com.au/t/cant-get-input-button-to-work/17624/2 "2023-07-19T09:36:51Z")

</div>

Hi Glenn  
Is the button actually closing the correct pins. Some buttons have 4 pins and if inserted 90º out it should (or maybe not) look like it is on all the time.

Another possibility check the proto board you are using. Some of these have not got the pos and /or neg rails connected all the way along. Look at the red or blue line. If it has ay breaks between groups of holes it will not be connected and you will have to link the groups.

Otherwise you will have to do some sleuthing.  
Cheers Bob

---

<div class="post-metadata">

### Author: ![Glenn195541](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/glenn195541/32/8705_2.png) [@Glenn195541](https://forum.core-electronics.com.au/u/Glenn195541)
#### Post date: [19 July 2023 13:23 UTC](https://forum.core-electronics.com.au/t/cant-get-input-button-to-work/17624/3 "2023-07-19T13:23:40Z")

</div>

Thanks Bob. Had my button wired to gnd and not +ve… oops 😊

---

<div class="post-metadata">

### Author: ![Glenn195541](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/glenn195541/32/8705_2.png) [@Glenn195541](https://forum.core-electronics.com.au/u/Glenn195541)
#### Post date: [19 July 2023 13:24 UTC](https://forum.core-electronics.com.au/t/cant-get-input-button-to-work/17624/4 "2023-07-19T13:24:12Z")

</div>

Those print commands are very useful.

---

<div class="post-metadata">

### Author: ![James](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/james/32/4400_2.png) [@James](https://forum.core-electronics.com.au/u/James)
#### Post date: [20 July 2023 02:17 UTC](https://forum.core-electronics.com.au/t/cant-get-input-button-to-work/17624/5 "2023-07-20T02:17:05Z")

</div>

Hi Glenn,

Glad to hear it was something simple!

For next time, remember that the Pico can pull both a pin up or down internally, or leave it floating, so you could connect your button to ground if that was easier, provided you had an internal pullup (set in software) or an external pullup (a resistor between the pin and 3.3V).

A bit more info here if you need it:  
[https://www.reddit.com/r/raspberrypipico/comments/n971i2/when\_are\_gpio\_pullup\_pulldown\_resistors\_needed/](https://www.reddit.com/r/raspberrypipico/comments/n971i2/when_are_gpio_pullup_pulldown_resistors_needed/)

---

<div class="post-metadata">

### Author: ![Glenn195541](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/glenn195541/32/8705_2.png) [@Glenn195541](https://forum.core-electronics.com.au/u/Glenn195541)
#### Post date: [24 July 2023 23:32 UTC](https://forum.core-electronics.com.au/t/cant-get-input-button-to-work/17624/6 "2023-07-24T23:32:42Z")

</div>

Thank you for that. I thought "PULLUP” meant there was actually a resistor installed. Pretty amazing you can simulate one, making the Pico an amazing device.

---

<div class="post-metadata">

### Author: ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)
#### Post date: [25 July 2023 02:41 UTC](https://forum.core-electronics.com.au/t/cant-get-input-button-to-work/17624/7 "2023-07-25T02:41:37Z")

</div>

Hi @James

> [@James](#):
>
> the Pico can pull both a pin up or down internally, or leave it floating

That’s awesome! Is this something the Arduino is capable of as well?

---

<div class="post-metadata">

### Author: ![Jeff105671](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/jeff105671/32/3729_2.png) [@Jeff105671](https://forum.core-electronics.com.au/u/Jeff105671)
#### Post date: [25 July 2023 03:40 UTC](https://forum.core-electronics.com.au/t/cant-get-input-button-to-work/17624/8 "2023-07-25T03:40:49Z")

</div>

Pullup only on the Arduino, but it is available for all the GPIO pins.

[Digital Input Pull-Up Resistor | Arduino Documentation](https://docs.arduino.cc/tutorials/generic/digital-input-pullup)  
[pinMode() - Arduino Reference](https://www.arduino.cc/reference/en/language/functions/digital-io/pinmode/)

---

<div class="post-metadata">

### Author: ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)
#### Post date: [25 July 2023 03:56 UTC](https://forum.core-electronics.com.au/t/cant-get-input-button-to-work/17624/9 "2023-07-25T03:56:50Z")

</div>

`pinMode(2, INPUT_PULLUP);`  
Ah that’s really useful. Thanks @Jeff105671 !
