thomasfredericks / Bounce2

Debouncing library for Arduino and Wiring
MIT License
584 stars 172 forks source link

Request: Allow multiple physical pins or software-only "pin" for each Bounce2 object #66

Closed EclipseBoom closed 4 years ago

EclipseBoom commented 4 years ago

In my application I have 2 different physical pins that control one logical function. It would be nice to be able to use the bounce2 methods to read and handle them as a logical input rather than in a 1:1 physical to logical mapping.

Also, it would be nice if there were a public method to programmatically set the object state via a software "pin". In my example I have a serial console so it would be nice if I could "press" a button via serial input command. This would also be really nice for test rigs to exercise the button inputs via software.

Don't know how widespread the use for these might be but I could make use of it...

thomasfredericks commented 4 years ago

Hi @EclipseBoom ,

That is why the current version of the library has been split into three classes. For your needs you would need to use the Debouncer class. See it in Bounce2.h.