Skip to content

madskjeldgaard/PicoDebounceButton

Repository files navigation

PicoDebounceButton

This is a small library for debouncing button presses on the Raspberry Pi Pico, using the Pico C++ SDK. It is inspired by Bounce2.

Example

For an example on how to use this project, see this.

Adding this library to your project

Using CPM

The easiest way to use this in your project is to install it using CPM. Add the following lines to your CMakeLists.txt. This will automatically download and include it in your CMake setup.

# Add Debounce
CPMAddPackage("gh:madskjeldgaard/PicoDebounceButton#main")
target_link_libraries(SimplePicoMidiController PicoDebounceButton::PicoDebounceButton)

Manually

If you have a project called SimplePicoMidiController, you can link this library in your CMakeLists.txt like so (assuming you downloaded the library and placed it in the path noted below):

# Add Debounce
set(PICO_DEBOUNCE_PATH "include/PicoDebounceButton")
add_subdirectory(${PICO_DEBOUNCE_PATH})
target_link_libraries(SimplePicoMidiController PicoDebounceButton::PicoDebounceButton)

Contributing

See the CONTRIBUTING document.