Skip to content

Commit

Permalink
Add pin mode definition to fix Button class on Pico 2
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-webb committed Dec 26, 2024
1 parent e8260bf commit 9883943
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion micropython/modules_py/pimoroni.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9883943

Please sign in to comment.