default

Example of the component esp-idf-lib/button v2.0.1
# Example for `button` component

## What it does

This example initializes two buttons and sets up a handler for them.

## Wiring

| Name | Description | Defaults |
|------|-------------|----------|
| `CONFIG_EXAMPLE_BUTTON1_GPIO` | GPIO number connected to the first button | "16" for `esp32`, `esp32s2`, and `esp32s3`, "6" for `esp32c2`, `esp32c3`, `esp32c5`, `esp32c6`, and `esp32c61`, "4" for `esp32h2`, and `esp32p4` |
| `CONFIG_EXAMPLE_BUTTON2_GPIO` | GPIO number connected to the second button | "17" for `esp32`, `esp32s2`, and `esp32s3`, "5" for `esp32c2`, `esp32c3`, `esp32c5`, `esp32c6`, and `esp32c61`, "3" for `esp32h2`, and `esp32p4` |

![Wiring](buttons_example.png?raw=true)

To create a project from this example, run:

idf.py create-project-from-example "esp-idf-lib/button=2.0.1:default"

or download archive (~21.59 KB)