The BOOTSEL button on the Pico is not connected to a standard GPIO, so it cannot be read using the usual digitalRead
function. It can, however, be read using a special (relatively slow) method.
The BOOTSEL
object implements a simple way of reading the BOOTSEL button. Simply use the object BOOTSEL
as a boolean (as a conditional in an if
or while
, or assigning to a bool
):
// Print "BEEP" if the BOOTSEL button is pressed if (BOOTSEL) { Serial.println("BEEP!"); // Wait until BOOTSEL is released while (BOOTSEL) { delay(1); } }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4