From 9883943dd0de9cfb9690cbfab75b278617800227 Mon Sep 17 00:00:00 2001 From: Isaac Webb <6345267+isaac-webb@users.noreply.github.com> Date: Thu, 26 Dec 2024 17:08:15 -0500 Subject: [PATCH] Add pin mode definition to fix Button class on Pico 2 --- micropython/modules_py/pimoroni.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/micropython/modules_py/pimoroni.py b/micropython/modules_py/pimoroni.py index f83b28179..d59bada57 100644 --- a/micropython/modules_py/pimoroni.py +++ b/micropython/modules_py/pimoroni.py @@ -96,7 +96,7 @@ def __init__(self, button, invert=True, repeat_time=200, hold_time=1000): self.invert = invert self.repeat_time = repeat_time self.hold_time = hold_time - self.pin = Pin(button, pull=Pin.PULL_UP if invert else Pin.PULL_DOWN) + self.pin = Pin(button, Pin.IN, Pin.PULL_UP if invert else Pin.PULL_DOWN) self.last_state = False self.pressed = False self.pressed_time = 0