I'm working on a project using the Adafruit Feather RP2040 and I'm having trouble detecting presses on the BOOTSEL button (which documentation says is also connected to GPIO4). The ultimate goal is to use this button to switch between different lighting patterns on a strip of Dotstar LEDs.
The Feather RP2040 is connected to the LEDs via the SCK and MO pins, and I have successfully run several scripts controlling the LED patterns using the FancyLED library. The BOOTSEL button is functioning as I've used it to enter bootloader mode to load CircuitPython on the board, but when I attempt to use it in any code, I don't see the expected responses.
To troubleshoot, I used this script to try print a message to the serial monitor whenever the BOOTSEL button is pressed or released:
Code: Select all
import board
import digitalio
import time
button = digitalio.DigitalInOut(board.D4)
button.switch_to_input(pull=digitalio.Pull.UP)
while True:
if not button.value: # button is pressed
print("Button pressed!")
time.sleep(0.1) # debounce delay
Any help or suggestions would be greatly appreciated! Thanks in advance!
-Tim