From d8adf308244d6193ad7c769a70bb4f160ed091c9 Mon Sep 17 00:00:00 2001 From: kingjin94 Date: Tue, 30 Mar 2021 14:42:00 +0200 Subject: [PATCH] Add get_pin to bounce object Make pin that Bounce is attached to publicly accessible --- src/Bounce2.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Bounce2.h b/src/Bounce2.h index ff20589..142e0f1 100644 --- a/src/Bounce2.h +++ b/src/Bounce2.h @@ -201,6 +201,15 @@ class Bounce : public Debouncer attach(pin); interval(interval_millis); } + + /** + @brief Return pin that this Bounce is attached to + + @return integer identifier of the coupled pin + */ + inline int get_pin() const { + return this->pin; + }; //////////////// // Deprecated //