8000 Add BOOTSEL documentation (#1722) · rondlh/arduino-pico@39238a5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 39238a5

Browse files
Add BOOTSEL documentation (earlephilhower#1722)
Co-authored-by: Earle F. Philhower, III <earle.philhower@kioxia.com>
1 parent f60b783 commit 39238a5

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

docs/bootsel.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
BOOTSEL Button
2+
==============
3+
4+
The BOOTSEL button on the Pico is not connected to a standard GPIO, so
5+
it cannot be read using the usual ``digitalRead`` function. It **can**,
6+
however, be read using a special (relatively slow) method.
7+
8+
The ``BOOTSEL`` object implements a simple way of reading the BOOTSEL
9+
button. Simply use the object ``BOOTSEL`` as a boolean (as a conditional
10+
in an ``if`` or ``while``, or assigning to a ``bool``):
11+
12+
.. code:: cpp
13+
14+
// Print "BEEP" if the BOOTSEL button is pressed
15+
if (BOOTSEL) {
16+
Serial.println("BEEP!");
17+
// Wait until BOOTSEL is released
18+
while (BOOTSEL) {
19+
delay(1);
20+
}
21+
}

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ For the latest version, always check https://github.com/earlephilhower/arduino-p
3030

3131
Analog I/O <analog>
3232
Digital I/O <digital>
33+
BOOTSEL Button <bootsel>
3334
EEPROM <eeprom>
3435
I2S Audio <i2s>
3536
PWM Audio <pwm>

0 commit comments

Comments
 (0)
0