-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
It would be helpful to explicitly highlight the difference between configuring a pin for BUTTON_A versus the BOOT (USER_SW) button.
BUTTON_A requires an internal pull-up resistor, while the BOOT / USER_SW button uses an internal pull-down resistor. This affects both how the pin must be configured and how the button state should be interpreted.
# BUTTON_A uses PULL_UP
>>> from machine import Pin
>>> button_a = Pin("BUTTON_A", Pin.IN, Pin.PULL_UP)
>>> button_a.value() # button pressed
0
>>> button_a.value() # button released
1
# BOOT / USER_SW uses the default PULL_DOWN
>>> user_sw = Pin("USER_SW", Pin.IN) # defaults to PULL_DOWN
>>> user_sw.value() # button pressed
0
>>> user_sw.value() # button released
1
Also with Button class, BOOT button does not seem to properly detect the button press.
>>> from pimoroni import Button
>>> user_sw = Button("USER_SW")
>>> user_sw.read() # always returns False, BUTTON_A works as expected
The above has been tested on Plasma 2350W with MicroPython feature/pico2_w_2025_3_11 (2025-03-31).
Metadata
Metadata
Assignees
Labels
No labels